Question:
how to call a excel macro present in existing .xla file?
jagdish_is_nice
2006-04-20 12:46:56 UTC
hi all

I want to call a excel macro present in a .xla file.
when I tried using run method it gives me error

Actually I am doing a small project in which I am transfering existing excel program to VB platform
the macros are not directly stored in the file I am using but in a different .xla file. ehwn I give the full path of .xls file to call the macro it gives me error that the given macro doesn't exist in same file .while it run well form the excel file

Please help me with this

Thanks in advance

"It is easy to draw a line .....where to draw it IS hard part"
Five answers:
2006-04-23 03:47:53 UTC
You can not run macros on closed files you have to open them first...

And

Where do you want to run that macro?

from VBE? you can use "application.run"

I have the full command line in my home pc, e-mail me if that is what you want.

Or

You can draw a circle and right click, select assign macro to make the macro runs when clicking the circle
?
2016-11-15 10:04:41 UTC
Xla File
icepero
2006-04-26 16:00:40 UTC
For Excel 2000, in VB you need to instantiate an Excel object, then you use the Application.Run "MacroName" method.



For an Excel 4.0 Macro, create the Excel object, then use:

Application.ExecuteExcel4Macro "RUN(""TestXLM"")"



For VB .NET it's a bit more complicated but you can find information here:

http://support.microsoft.com/?kbid=306682
2006-04-20 12:49:38 UTC
open both the xla file and the xls file,

then click on 'vb editor'

or 'tools - macros - macros' and select the particular macro to run.



hope that helps.
?
2016-12-01 04:03:40 UTC
Any record that has a .XLA extension like what you element out that your record has, would have what are talked about as upload-Ins extra to them. In lamens words, that signifies that someone has extra programming to the record to probably do some more desirable issues and make it with slightly of luck less demanding to apply. in case you disable the upload-Ins like the only human being stated, particular constructive houses or applications that you're prepared to apply on that workbook would now not be able to be used. So be careful about doing that. you are able to prevent that annoying message like the only human being suggested through replacing the Macro protection element in Excel. to objective this bypass to: procedures > Macro > protection... frequently, Excel through default is keen to both severe or Medium. in person-friendly words the low placing will open one of those record like that which has macros or upload-ins without even asking you even if it would open it or not. As you'll likely locate out in case you examine the protection labels, replacing the placing to low leaves you weak to a conceivable Macro virus which will be contained in the Excel record. So only be careful that the archives you open come from a relied on source in case you adjust the placing to low. One very last word, only replacing the protection placing received't extremely restore the priority without delay. to be sure that the protection placing to take impression, you need to completely close out Excel and reopen it. once you reopen excel the Macro protection element will take impression. If the placing is keen to severe or Very severe for Macro protection it received't even enable a macro to run except it comes from someone with a digital signature as being a relied on source.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...