+ Reply to Thread
Results 1 to 2 of 2

VBA code to change backup directory using Orlando’s XLtoEXE

  1. #1
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    VBA code to change backup directory using Orlando’s XLtoEXE

    Hi All,

    I have an Excel program that I put together and which I use for carrying out certain analysis of my small business. In order to avoid the constant ‘enable-macro’ alert whenever I open the program, I found and started using Orlando’s XLtoEXE free little utility.

    The utility can be found at the following link - http://orlando.mvps.org/ - (for anyone else who may be interested): The utility allows me to work with Excel without macro alerts for my Excel macro-enabled program. I find it very useful.

    Whenever I open and EXIT the Excel file which I converted to EXE, a backup copy of the file (i.e. my program) is created. That is fine!. However, what I do not like is that the backup copy resides beside my main program in the same folder. I would prefer that the backup copy of my program is saved in a different folder stored away from the main copy.

    In the Book1 sample which Orlando himself created to help users for reference, he provided a backup vba code which he said could be tweaked to suit one’s purpose. He indicated that if a user wishes to save the backup to a different folder, the sXLtoEXE_SaveCopyAsExe variable could be used to achieve that purpose. I have appended below the said sXLtoEXE_SaveCopyAsEXE code:

    Please Login or Register  to view this content.
    Please, I need help to tweak the code for me, so that the backup copy of my XLtoEXE-converted program would always be saved in my own defined or chosen folder.

    I would liked to attach an abridged version of my XLtoEXE-converted program. But when I tried, it came up as 'invalid file'. I suppose because it has a .exe extension. I can email a copy each of both Orlando's Book1 sample and my own XLtoEXE-converted program to anyone who wants to help me and wishes to see the files. Meanwhile, if you open up my converted program and then click the SAVE/EXIT button, a backup copy of it would appear beside it – which is not what I want.

    I should be very grateful if someone would, please, tweak the above code for me and also kindly advise me on where to put the tweaked version (either in ‘TheWorkbook’ module or standard module) to enable me to achieve the result that I desire.

    I currently have my main exe-converted program on my desktop. I would like to ‘define’ or ‘choose’ a folder somewhere, say in ‘My documents’ folder where the backup would reside whenever I exit the program.

    Thank you all for your anticipated help with this.

    Newqueen

  2. #2
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    Re: VBA code to change backup directory using Orlando’s XLtoEXE

    Could someone please help with this. I would be very grateful.

    Thanks.

    Newqueen

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1