ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Private Sub Workbook_Open() doesn't run (https://www.excelbanter.com/excel-discussion-misc-queries/138932-private-sub-workbook_open-doesnt-run.html)

Steve Starr

Private Sub Workbook_Open() doesn't run
 
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!

JE McGimpsey

Private Sub Workbook_Open() doesn't run
 
You probably don't have it stored in your ThisWorkbook code module...

In article ,
Steve Starr <Steve wrote:

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


Steve Starr[_2_]

Private Sub Workbook_Open() doesn't run
 
I knew it was something simple. Thanks!

"JE McGimpsey" wrote:

You probably don't have it stored in your ThisWorkbook code module...

In article ,
Steve Starr <Steve wrote:

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



Thomas Jambrich

Private Sub Workbook_Open() doesn't run
 
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

On Friday, April 13, 2007 11:06 PM Steve Star wrote:


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!



On Saturday, April 14, 2007 1:11 AM JE McGimpsey wrote:


You probably do not have it stored in your ThisWorkbook code module...



On Saturday, April 14, 2007 2:44 AM SteveStar wrote:


I knew it was something simple. Thanks!

"JE McGimpsey" wrote:





GS[_2_]

Private Sub Workbook_Open() doesn't run
 
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.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc




All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com