How do I autostart VBA code when I open a Microsoft Publisher document...

Lidsavr

Active Member
Joined
Jan 10, 2008
Messages
330
I have written a macro that executes well in Microsoft Publisher (the macro changes a date). What I want to do is have the macro start when I open the document and the date changes.

Does anyone know code or a switch in Publisher that would automatically execute a macro at startup? We searches revealed that macros in Microsoft Word will auto-start with this code:

VBA Code:
Sub AutoStart ()

But I tried this in Publisher and it does not work. Does anyone know of a way?

Thank you,

Lidsavr
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Select the following in the VBE :

Open.jpg
 
Upvote 0
Solution
Perfect! Thank you.

I have looked and looked at different documentation but could not find anything. You have made my life a lot easier.

Lidsavr
 
Upvote 0

Forum statistics

Threads
1,216,500
Messages
6,131,016
Members
449,615
Latest member
Nic0la

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