create exe to install xls file to xlstart

ratt2581

Board Regular
Joined
Nov 11, 2006
Messages
100
at work we have a macro sheet that is shared through multiple users so anytime its updated we send it out and they have to save it over in their c:\Documents and Settings\USERNAME\Application Data\Microsoft\Excel\XLSTART

now while this usually isnt a daunting task - some ppl have an issue and I was hoping someone could help me create (or steer me to some good websites) a standalone .exe file that would have the macro.xls spreadsheet inside it.

So all the users would have to do was double click the .exe file and it would automatically save the file to the right location and thus end anymore headaches.

I have access to visual studios and have familarity in a few different programming languages - just no experience using VS or building a .exe

Thanks for any potential help
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I did something like this for a split Access database. Basically, the front end was on the Local Machines, but I often had updates, so I needed to ensure that they were automatically copied over the the Local Machines whenever someone tried to run them.

I did this with a simple DOS batch file. All you need to do is enter the code in a text editor and save it with a .BAT extension. Then whenever it is clicked on, it automatically runs. So this is the shortcut I put on people's desktop.

Here is a simple example. I will explain how it works:
Code:
echo off
::  CHECK FOR EXISTENCE OF NEWEST VERSION ON LOCAL MACHINE (currently v2)
IF EXIST "C:\Program Files\MyExcelFile_v2.xls" GOTO OPENXLSFILE

::  COPY NEWEST VERSION FROM NETWORK TO LOCAL MACHINE
del " C:\Program Files\MyExcelFile_v*.*"
copy "W:\MyExcelFile_v2.xls" "C:\Program Files\MyExcelFile_v2.xls"

:OPENXLSFILE
::  OPEN LOCAL COPY OF EXCEL FILE
"C:\Program Files\MICROSOFT OFFICE\OFFICE10\EXCEL.EXE" C:\Program Files\MyExcelFile_v2.xls

"C:\Program Files\MICROSOFT OFFICE\OFFICE11\EXCEL.EXE" C:\Program Files\MyExcelFile_v2.xls

"C:\Program Files\MICROSOFT OFFICE\OFFICE\EXCEL.EXE" C:\Program Files\MyExcelFile_v2.xls

EXIT
Basically, I save the Excel file with a version number after it. So the first one ends in "v1". The next time I need to change it, I save it with a "v2" after it, etc.

So what this macro does is first checks to see if the user has the most recent version of the Excel file copied to their Local Machine. If they do not, then it first deletes the old version out there, then copies the new version from the Network Drive to the Local Machine. It then opens the file from the Local Machine.

Note that I have three different commands for opening the file. The only difference is the Office directory (either Office, Office10, or Office11). This is due to the fact that we have multiple different versions of Excel running in our office (97, 2000, 2002). You only need to list the ones that your office is using. You can determine this easily enough by browsing to these directories and seeing where the Excel application resides. It does not hurt anything to have the extras out there. Those attempts are simply errored out and bypassed, unknown to the user.

So the only thing you really need to do maintain this is:
- Create this .bat file and place it somewhere on the server and put shortcuts to this .bat file on people's desktops
- Keep a master copy of your must current version of your Excel file on the server
- As you make changes/updates to your Excel file, save the new version with a new version number and then update the batch file to reflect those changes.

And voila, everything else takes care of itself!
 
Upvote 0
Thanks - we debated the batch file method but decided against because not everyone will always have access to the network location (I argued that it was too few a time to matter, but...)

The thought was an exe with the xls embedded in would always be available as long as ppl had access to their email.
 
Upvote 0
not everyone will always have access to the network location
There isn't one common "share" drive at your work that everyone has access to (or you can give everyone access to)?

From your response, I am guessing not. It just seems a little odd, especially if people are using the same programs.
 
Upvote 0

Forum statistics

Threads
1,225,363
Messages
6,184,519
Members
453,238
Latest member
visuvisu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top