Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

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".