Private Sub Workbook_Open() doesn't run

G

Guest

I've created a macro Private Sub Workbook_Open(), but it doesn't run when I
open the workbook. I have set the security to allow all macros and made the
folder with the workbook a trusted site. The marco runs fine if I execute it
using the Macro's menu or from VB.

I don't get an error message or any indication at all.

I also tried Sub Auto_Open() with no result there either.

Can anyone give me a clue as to what might be blocking this fuctionality.

Thanks!
 
T

Thomas Jambrich

Hi There

I have the same problem. I looked at the answer but it doesn't seem to help me. I created my macros in Excel 2003. One of the macros is in "ThisWorkbook" under 'Microsoft Excel Objects' and it created a ?toolbar? (say MyToolbar) when the workbook was opened under Excel 2003. It contains a list of various macros that I could click on to execute various functions in the workbook. The others are under either in the ?Modules? or ?Forms?. The macros that are under the ?Modules? or ?Forms? seem to run when I click on them in the Visual Basic code form, but the macro in the 'ThisWorkbook" does not, i.e. it doesn't insert my toolbar nor does it open MyToolbar when I open the workbook. Can anyone help me please?


TJ
 
G

GS

After serious thinking Thomas Jambrich wrote :
I have the same problem. I looked at the answer but it doesn't seem to help
me. I created my macros in Excel 2003. One of the macros is in
"ThisWorkbook" under 'Microsoft Excel Objects' and it created a ?toolbar?
(say MyToolbar) when the workbook was opened under Excel 2003. It contains
a list of various macros that I could click on to execute various functions
in the workbook. The others are under either in the ?Modules? or ?Forms?.
The macros that are under the ?Modules? or ?Forms? seem to run when I click
on them in the Visual Basic code form, but the macro in the 'ThisWorkbook"
does not, i.e. it doesn't insert my toolbar nor does it open MyToolbar when I
open the workbook. Can anyone help me please?

Please post your code so we can better help you based on that rather
than guessing all over the place!

One thing I know for sure is that you can't have code in both
Workbook_Open AND Auto_Open(). It has to be one or the other. Also,
Auto_Open MUST be placed in a standard module under the Modules section
of a project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top