PDA

View Full Version : How to make an Excel Macro globally available?



deyken
01-19-2012, 11:43 PM
Hi Guys!

I wrote a "generic" macro that connects to a database and uploads an Excel document's content into a SQL Server 2008 database. I need this macro to be globally available, so that I do not have to put the macro code into every single one of these excel workbooks. I also need to do this on our company's netweork so that other users have the same access to this macro.

I tried connecting this macro to a button, wehich I placed onto the Quick Access Toolbar and it seemed to work for a bit. Now, however, it tells me that this macro is not available to my Excel application.

My question is: Can I place the macro code somewhere in a DLL or other globally available place where any Excel application can access it?

PS: I also tried saving it as an Excel Add-In and then importing it into several users' Excel Applications, but this do not seem to work...

Any help would be appreciated. Thank you very much in advance!!

Aflatoon
01-20-2012, 01:45 AM
Creating an addin will work. I'm not sure what you mean by "importing it into several users' Excel Applications"?

Kenneth Hobs
01-20-2012, 09:43 AM
Of course you can use a DLL and put it into their c:\Windows\System32. It might need to be registered though. You could use .net and make an EXE and put it in a central location. You could use a regular XLSM and they can use Application.Run() to run it.

The Add-in method will probably work though.