Invoking 'BeforeSave' from macro in another Workbook

jasonking

New Member
Joined
Apr 24, 2002
Messages
3
- I have a Workbook 'A' that contains a macro, which places data into Workbook 'B'.
(Note that both Workbooks are loaded in Excel).

- B contains code in it's 'BeforeSave' event, which protects the sheets before it is saved.

- The last command of the macro in A, saves B. So, the 'BeforeSave' event is invoked.

- However, Excel happily runs the code in the 'BeforeSave' but doesn't actually perform the commands! The result is no protected sheets in B.

The 'BeforeSave' event code works fine on its own, but doesn't seem to work when invoked by another macro??

Note: I am using Excel 2000 with all the latest patches installed.

Please could anyone help.

Many thanks,
Jason
This message was edited by jasonking on 2002-04-25 08:24
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I am new to macros, and have NO programming experience. Most of the simple macros I use are modified from others, if I can figure out how to modify it. How does one go about saving data from workbook A in workbook B?

I have to do this in excel (one worksheet only from A into B, but be must be created and saved with the macro).

I have posted a similar question before on how to do this from excel to word, and was never able to figure that our either...
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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