7 Replies Latest reply: Feb 20, 2017 6:32 PM by Rob Wunderlich RSS

    Using relative path in macro

      What I am trying to achieve:

      I created a button that will allow me to export activated charts to a folder. So i name this folder Exports and use relative paths for convenience sake because I intend to put it on server.

       

      What i tried:

      There is no issue exporting it using the absolute path that has been commented out below.

       

      What i know:

      the syntax "..\" basically goes one folder higher.

       

      Current Dashboard path:

      C:\Users\muzamirnasir\Desktop\ACGME-I Survey\Dashboard

       

      Problem:

      I cannot seem to get the relative path to work.Nothing is exported, even if it is wrong, the file should still be somewhere. It seems to work for "STORE" on another dashboard.

      What did i miss out? Is there a way out of this? Any examples? Is it ExportBitMapToFile?

       

      I currently coded this out on Macro..

       

      'Export for Details tab

      SUB SaveBitmapDetails

       

      'SET obj = ActiveDocument.GetSheetObject("CH87")

      'obj.ExportBitmapToFile "C:\Users\muzamirnasir\Desktop\ACGME-I Survey\Exports\CH87.jpg"

       

       

      SET obj = ActiveDocument.GetSheetObject("CH75")

      obj.ExportBitmapToFile "..\..\Exports\CH75.jpg"

       

      END SUB