marc
marc

Reputation: 11

VBA references in exe

I recently made an Excel-tool, which makes heavy use of VBA macros. This tool works perfectly on my pc, and on most of my colleagues pc's, but I noticed that it doesn't work on some other pc's. This is because some of the required reference files are not present on those pc's.

I would like to solve this by making an exe-file of the original Excel document, in which all the referenced files are included. I already tried this with Winrar, but I noticed that, after unpacking the exe, the reference files are unpacked in the folder in which the exe file was copied, but not in the required system folders.

How can I fix this, so that I can use the tool on whichever computer I'd like to?

Thanks in advance!

Kind regards, Marc

Upvotes: 0

Views: 363

Answers (3)

mwolfe02
mwolfe02

Reputation: 24207

I highly recommend you try Inno Setup. It has a higher initial learning curve, but it is well worth it for the enhanced functionality over WinRAR (for this type of thing). Inno-Setup creates installers from plain-text setup files, however, the "Quick Start Pack" includes a GUI front-end for making this part easier.

Upvotes: 0

Dr. belisarius
Dr. belisarius

Reputation: 61016


Just to be sure:

Winrar shows something like this:

alt text

and you should be selecting either "Store full paths" (better) or "Store full paths including drive letter" (worse)

Upvotes: 0

Hans Olsson
Hans Olsson

Reputation: 54999

Michael Todd's comment about licensing is something worth checking up, but assuming that's ok, you could just write a simple batch file and/or script to first unrar the files and then copy them into the relevant directories. This script would preferably be executed during installation of your excel document.

However, depending on what files they are I'd would be wary of copying them into system directories. Firstly, will you have permissions to write to those directories? Secondly, is it possible that you'll overwrite other versions of those dlls, possibly overwriting a newer version with an older version. Depending on what DLLs you're trying to copy, you might break other applications or even Windows itself by copying them in.

In general, if the solution to your problem is to copy random dlls from your machine to someone else's machine, you should look for an alternative solution. I'd suggest that the better solution might be to change your application to not reference those dlls, or if that can't be done, do a proper install of the application where those dlls come from on the machines where you have the problem .

Upvotes: 1

Related Questions