# Accessing QlikView documents from the internal VBScript interpreter

When using the internal VBScript interpreter, the only reference available is the ActiveDocument special property of the class Application. All references must be made starting from that point.

Information noteThe ActiveDocument property from VBScript provides a reference to the QlikView document running the VBScript macro!

## Examples

Example 1:

```
rem ** VBScript Example 1 **
sub Clr
	set QVDoc = ActiveDocument
	QvDoc.ClearAll false
end sub
```

Example 2:

```
rem ** VBScript Example 2 **
sub a
	set up = ActiveDocument.GetApplication.GetUserPreferences
	Cp = up.ConfirmPurge 
	if Cp=true then 
		msgbox("Warning! No Reduce Data confirmation!")
	end if
end sub
```

Example 3:

```
rem ** VBScript Example 3 **
set doc1 = ActiveDocument
rem ** ActiveDocument points at document running macro **
set App = doc1.GetApplication
set newdoc = App.OpenDoc ("C:\MyDocuments\QV4_Automation.qvw","","")
newdoc.Activate
rem ** Note! newdoc is active but ActiveDocument points at doc1 **
```