Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Object Required: obj

Hi Everyone,
I get the following error when trying to Export a Straight Table to a CSV (Object Required: obj) from the last line of my script. Anyone know what causes it?
Sub ExportMyTable

'Comment this part out if you want to Export your Selection made...
Activedocument.ClearAll

vFile = "c:\WhereEver\YourDesiredFileName.csv"

vDirectory  = "c:\WhereEver\"

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Either use or create a directory pending on whether it exists
If objFSO.FolderExists(vDirectory) Then
Set objFolder = objFSO.GetFolder(vDirectory)
Else
Set objFolder = objFSO.CreateFolder(vDirectory)
End If


set obj = ActiveDocument.GetSheetObject("CHO1")

obj.ExportEx vFile, 1

End Sub
1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

The set obj = ActiveDocument.GetSheetObject("CHO1") is not assigning the object to the variable obj.  I think the problem is that you are using the letter "O" instead of the number "0" in the object ID "CH01".

View solution in original post

1 Reply
pover
Partner - Master
Partner - Master

The set obj = ActiveDocument.GetSheetObject("CHO1") is not assigning the object to the variable obj.  I think the problem is that you are using the letter "O" instead of the number "0" in the object ID "CH01".