1 Reply Latest reply: Nov 11, 2009 6:56 AM by Rakesh Mehta RSS

    Why is my macro not working?

    Amirali Vastani

      The code below in the OnPostReload Trigger for Run Macro give me an error

      Cannot open filename111009.csv for writing!

      Does anyone know what I am doing is wrong?

       

      sub exportList
      set obj = ActiveDocument.GetSheetObject("TB01")
      File = "'filename' & timestamp(now(), 'MMDDYY') & '.csv'")
      obj.Export File, ";"
      'obj.ServerSideExport File, ";"
      end sub


      I have set the Mofule Security & Local Security to Allow System Access. I am on a 64bit QV and will be pushing it to the server to make it auto export onpostreload. Thanks in advance for your help.

        • Why is my macro not working?
          Rakesh Mehta

          You should provide comlete path. It seems, it's trying to save in some windows folders, which is not allowed, especially in Vista environment. Itried following and it works fine:

          sub exp
          set obj = ActiveDocument.GetSheetObject("TB01")
          File = "C:\Temp\filename" & DatePart("M", timeStamp) & DatePart("D", timeStamp) & DatePart("YYYY", Date) & ".csv"
          obj.Export File, ";"
          end sub