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