activating a different workbook without knowing its name.

motybetesh

New Member
Joined
Jun 4, 2002
Messages
19
Hello there
1. I have a file where I record a list of information.
2. that information is copied, by a macro, from an XML file such as 6550010000305931007020640-procNfe.xml
3. first I change it to .xls and open it, (or even without changing it) it opens as pasta1, pasta2.....

I´m trying to execute the macro that is on the permanent workbook. (I have for that macro a button on the excel menu) but clicking on it, gives a massage that the macro is not available on the that workbook (pasta1, pasta2.... name keep changing)

I would like to know how do I get the macro to start without its workbook being active ?
Or if I start with it, how do I tell excel to look for the other files ?

Thanks
Moty
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
by permanent I mean the file where I record the data, the name of it doesn't change.
if I rename the 6550010000305931007020640-procNfe.xml to end with xls it will open as pasta1....
 
Upvote 0
Yes, but how are you opening it? Is it in the same instance of Excel as the workbook that contains the macro that you want to run?
 
Upvote 0
Macro was created as a user command, then I looked for that macro and added its button to the menu. same way you would add other available commands.
 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

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