ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to easily (!) load Macros from external files on demand? (https://www.excelbanter.com/excel-discussion-misc-queries/243462-how-easily-load-macros-external-files-demand.html)

Artur McCennon

How to easily (!) load Macros from external files on demand?
 
Assume I have a VB macro for Excel in an external text file mymacro.vb

Now I open a worksheet in Excel and want to have this macro available.

Ok, I could load it with ALT+F11 into Macro Editor and the launch it with lots of menu clicks
but this is somehow cumbersome and unconvenient.

I am searching for a way to (double)click on this macro file or drag it onto Excel and have it
immediately available.

Is something like this possible?

Arthur


Bob Phillips[_3_]

How to easily (!) load Macros from external files on demand?
 
Rename it to .bas, and add a button to the VBIDE to import it.

--
__________________________________
HTH

Bob

"Artur McCennon" wrote in message
...
Assume I have a VB macro for Excel in an external text file mymacro.vb

Now I open a worksheet in Excel and want to have this macro available.

Ok, I could load it with ALT+F11 into Macro Editor and the launch it with
lots of menu clicks
but this is somehow cumbersome and unconvenient.

I am searching for a way to (double)click on this macro file or drag it
onto Excel and have it
immediately available.

Is something like this possible?

Arthur




Dave Peterson

How to easily (!) load Macros from external files on demand?
 
You may want to take an alternative approach.

Create a workbook with the macro already in it and save it as a Template (*.xlt
or *.xltm). Then instead of starting a empty workbook, use that template file.

One thing nice about this is that you don't have to worry about the user's
security settings (if you share it other users) and you can protect the project
in the template.

Artur McCennon wrote:

Assume I have a VB macro for Excel in an external text file mymacro.vb

Now I open a worksheet in Excel and want to have this macro available.

Ok, I could load it with ALT+F11 into Macro Editor and the launch it with lots of menu clicks
but this is somehow cumbersome and unconvenient.

I am searching for a way to (double)click on this macro file or drag it onto Excel and have it
immediately available.

Is something like this possible?

Arthur


--

Dave Peterson


All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com