#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Auto Open Macro

Does anyone know of a Macro such as: Auto_Open or On_Open.
I think there is something someplace in Excel or VB that has this command.
Please let me know where it is at, if there is one. I can not find either in
Excel Help or VB Help.

Thanks
Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Open Macro

Auto_open will do the trick if placed into a General module.

Sub Auto_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

Workbook_Open is used in Thisworkbook module.

Private Sub Workbook_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

If you go to VB help and type in "workbook event code" you will get a list of
supported events.


Gord Dibben MS Excel MVP

On Fri, 20 Jul 2007 00:23:59 GMT, "Launchnet" <u20911@uwe wrote:

Does anyone know of a Macro such as: Auto_Open or On_Open.
I think there is something someplace in Excel or VB that has this command.
Please let me know where it is at, if there is one. I can not find either in
Excel Help or VB Help.

Thanks
Matt@Launchnet


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Auto Open Macro

Hi Gord

Sorry, my coding is terrible. I tried test 1 & 2 and naturally, neither
worked.
I really want Test 2 to run when the workbook is opened.
All my macros are in the General Module and that is where I placed the below
code.

Thanks for your help in advance
Matt@Launchnet

Sub auto_open()
MsgBox "Welcome to MyMenu"

'Test 1
Run_macro Picture3_Click 'Picture3_Click is the macro I
want to run only

'Test 2
Application.Goto Reference:="R1C1" 'or . . . this row only.

End Sub

Gord Dibben wrote:
Auto_open will do the trick if placed into a General module.

Sub Auto_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

Workbook_Open is used in Thisworkbook module.

Private Sub Workbook_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

If you go to VB help and type in "workbook event code" you will get a list of
supported events.

Gord Dibben MS Excel MVP

Does anyone know of a Macro such as: Auto_Open or On_Open.
I think there is something someplace in Excel or VB that has this command.

[quoted text clipped - 3 lines]
Thanks
Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 146
Default Auto Open Macro

Did you put Call Test2 in the auto_open subroutine?
Your coding doesn't show it. If you don't call it, Test2 won't get done.
You can use either Call Test2 or simply Test2()


"Launchnet via OfficeKB.com" <u20911@uwe wrote in message
news:756ef64e728aa@uwe...
Hi Gord

Sorry, my coding is terrible. I tried test 1 & 2 and naturally, neither
worked.
I really want Test 2 to run when the workbook is opened.
All my macros are in the General Module and that is where I placed the
below
code.

Thanks for your help in advance
Matt@Launchnet

Sub auto_open()
MsgBox "Welcome to MyMenu"

'Test 1
Run_macro Picture3_Click 'Picture3_Click is the macro I
want to run only

'Test 2
Application.Goto Reference:="R1C1" 'or . . . this row only.

End Sub

Gord Dibben wrote:
Auto_open will do the trick if placed into a General module.

Sub Auto_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

Workbook_Open is used in Thisworkbook module.

Private Sub Workbook_Open()
msgbox "Good Morning"
or run a macro by name
End Sub

If you go to VB help and type in "workbook event code" you will get a list
of
supported events.

Gord Dibben MS Excel MVP

Does anyone know of a Macro such as: Auto_Open or On_Open.
I think there is something someplace in Excel or VB that has this
command.

[quoted text clipped - 3 lines]
Thanks
Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Auto Open Macro

Here is what I tried:

Sub auto_open()
MsgBox ("Welcome to MyMenu")
Picture3_Click() 'This is my sub-routine name
End Sub

The message box does not appear and sub-routine Picture3_Click() did not do
anything

I even tried Call Picture3_Click()
when i moved off that code line the () disappeared - It still didn't work
either.

Help Again Pleasee

Matt@Launchnet

Dave Thomas wrote:
Did you put Call Test2 in the auto_open subroutine?
Your coding doesn't show it. If you don't call it, Test2 won't get done.
You can use either Call Test2 or simply Test2()

Hi Gord

[quoted text clipped - 46 lines]
Thanks
Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 146
Default Auto Open Macro

I inserted a module in a new workbook, put the code below in it, saved it,
closed it , opened it and got the 2 messages shown below..

Sub auto_open()
MsgBox ("here in autoopen")
Call testit
End Sub
Sub testit()
MsgBox ("This is testit")
End Sub

"Launchnet via OfficeKB.com" <u20911@uwe wrote in message
news:756f8b69c022a@uwe...
Here is what I tried:

Sub auto_open()
MsgBox ("Welcome to MyMenu")
Picture3_Click() 'This is my sub-routine name
End Sub

The message box does not appear and sub-routine Picture3_Click() did not
do
anything

I even tried Call Picture3_Click()
when i moved off that code line the () disappeared - It still didn't work
either.

Help Again Pleasee

Matt@Launchnet

Dave Thomas wrote:
Did you put Call Test2 in the auto_open subroutine?
Your coding doesn't show it. If you don't call it, Test2 won't get done.
You can use either Call Test2 or simply Test2()

Hi Gord

[quoted text clipped - 46 lines]
Thanks
Matt@Launchnet


--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via http://www.officekb.com



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,290
Default Auto Open Macro


Just in case...
If a workbook is opened using VBA code then any Auto_Open macros
will not run. They must be called using the RunAutoMacros method.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Dave Thomas"
wrote in message
I inserted a module in a new workbook, put the code below in it, saved it,
closed it , opened it and got the 2 messages shown below..

Sub auto_open()
MsgBox ("here in autoopen")
Call testit
End Sub
Sub testit()
MsgBox ("This is testit")
End Sub

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Auto Open Macro

Thanks Everybody. I was for ease in development only, opening my file with a
macro.
As soon as I tried it opening it directly from Excel, it works fine.

Again Thanks
Matt@Launchnet

Jim Cone wrote:
Just in case...
If a workbook is opened using VBA code then any Auto_Open macros
will not run. They must be called using the RunAutoMacros method.


--
Message posted via http://www.officekb.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Using Container in Auto open macro [email protected] Excel Discussion (Misc queries) 0 November 9th 06 11:22 AM
How to auto activate macro when file open ? bonzio Excel Worksheet Functions 1 December 16th 05 02:45 PM
Auto Open Syed Zeeshan Haider Excel Discussion (Misc queries) 2 June 1st 05 03:39 PM
How do I get my personal macro worksheet to open whenever I open . Claudia_R Excel Discussion (Misc queries) 3 December 9th 04 11:59 PM


All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"