1 Reply Latest reply: Mar 28, 2012 5:48 PM by Karl Pover RSS

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

      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)
      Set objFolder = objFSO.CreateFolder(vDirectory)
      End If

      set obj = ActiveDocument.GetSheetObject("CHO1")

      obj.ExportEx vFile, 1

      End Sub