PC Review


Reply
Thread Tools Rate Thread

How to run auto-open macro in Excel 2007?

 
 
jeh
Guest
Posts: n/a
 
      23rd Jan 2010
For years I've been using an Excel 2000 workbook (under Win XP)
containing several macros, one of which is auto-opened at launch. (It
performs necessary date checks). Security has been set so that before
the workbook opens I get a warning text box asking me if I want to
enable or disable macros.

I've just ported the workbook to Office 2007 in a new computer running
Win 7 Pro. With this system I find that when the workbook opens (in
compatibilty mode), the current worksheet and the warning bar about
macros appear simultaneously. I can accept or reject macro operation
as I wish, but even if I accept it the auto-open macro hasn't run. Any
ideas how to get round this? I'm in unfamiliar territory with no
previous experience of Win 7 and not much of Office 2007. Have I just
missed something simple?

I can't use self-signed certificates because the workbook will be used
on more than one computer.

TIA John
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Jan 2010
I don't use win7, but I've never experienced any problems with my auto_open or
workbook_open procedures that were written in xl97 to xl2003 when opened in
xl2007.

I allow macros to run and they fire successfully.

Maybe it's the macro itself????

Could you add a
msgbox "Running"
as the first line inside the code--just to see if the code actually starts???

jeh wrote:
>
> For years I've been using an Excel 2000 workbook (under Win XP)
> containing several macros, one of which is auto-opened at launch. (It
> performs necessary date checks). Security has been set so that before
> the workbook opens I get a warning text box asking me if I want to
> enable or disable macros.
>
> I've just ported the workbook to Office 2007 in a new computer running
> Win 7 Pro. With this system I find that when the workbook opens (in
> compatibilty mode), the current worksheet and the warning bar about
> macros appear simultaneously. I can accept or reject macro operation
> as I wish, but even if I accept it the auto-open macro hasn't run. Any
> ideas how to get round this? I'm in unfamiliar territory with no
> previous experience of Win 7 and not much of Office 2007. Have I just
> missed something simple?
>
> I can't use self-signed certificates because the workbook will be used
> on more than one computer.
>
> TIA John


--

Dave Peterson
 
Reply With Quote
 
 
 
 
jeh
Guest
Posts: n/a
 
      23rd Jan 2010
Thanks Dave. Problem fixed. The auto-open macro does run as soon
once Macros are enabled. I was fooled by the worksheet appearing
before I could enable macros, the opposite of the sequence in xl2k.

John.



On Jan 24, 1:07*am, Dave Peterson <(E-Mail Removed)> wrote:
> I don't use win7, but I've never experienced any problems with my auto_open or
> workbook_open procedures that were written in xl97 to xl2003 when opened in
> xl2007.
>
> I allow macros to run and they fire successfully.
>
> Maybe it's the macro itself????
>
> Could you add a
> msgbox "Running"
> as the first line inside the code--just to see if the code actually starts???
>
>
>
>
>
> jeh wrote:
>
> > For years I've been using an Excel 2000 workbook (under Win XP)
> > containing several macros, one of which is auto-opened at launch. *(It
> > performs necessary date checks). *Security has been set so that before
> > the workbook opens I get a warning text box asking me if I want to
> > enable or disable macros.

>
> > I've just ported the workbook to Office 2007 in a new computer running
> > Win 7 Pro. *With this system I find that when the workbook opens (in
> > compatibilty mode), the current worksheet and the warning bar about
> > macros appear simultaneously. *I can accept or reject macro operation
> > as I wish, but even if I accept it the auto-open macro hasn't run. Any
> > ideas how to get round this? *I'm in unfamiliar territory with no
> > previous experience of Win 7 and not much of Office 2007. *Have I just
> > missed something simple?

>
> > I can't use self-signed certificates because the workbook will be used
> > on more than one computer.

>
> > TIA * John

>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      23rd Jan 2010

Just as a side note, the Auto_Open procedure (indeed all the Auto
procedures) does not run if the workbook is opened via code. For
example,

Dim WB As Workbook
Set WB = Workbooks.Open("C:\Test.xls")

The Auto_Open proc of C:\Test.xls will not be executed. You must call
it yourself if it needs to run:

WB.RunAutoMacros xlAutoOpen

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Sat, 23 Jan 2010 14:05:25 -0800 (PST), jeh
<(E-Mail Removed)> wrote:

>Thanks Dave. Problem fixed. The auto-open macro does run as soon
>once Macros are enabled. I was fooled by the worksheet appearing
>before I could enable macros, the opposite of the sequence in xl2k.
>
>John.
>
>
>
>On Jan 24, 1:07*am, Dave Peterson <(E-Mail Removed)> wrote:
>> I don't use win7, but I've never experienced any problems with my auto_open or
>> workbook_open procedures that were written in xl97 to xl2003 when opened in
>> xl2007.
>>
>> I allow macros to run and they fire successfully.
>>
>> Maybe it's the macro itself????
>>
>> Could you add a
>> msgbox "Running"
>> as the first line inside the code--just to see if the code actually starts???
>>
>>
>>
>>
>>
>> jeh wrote:
>>
>> > For years I've been using an Excel 2000 workbook (under Win XP)
>> > containing several macros, one of which is auto-opened at launch. *(It
>> > performs necessary date checks). *Security has been set so that before
>> > the workbook opens I get a warning text box asking me if I want to
>> > enable or disable macros.

>>
>> > I've just ported the workbook to Office 2007 in a new computer running
>> > Win 7 Pro. *With this system I find that when the workbook opens (in
>> > compatibilty mode), the current worksheet and the warning bar about
>> > macros appear simultaneously. *I can accept or reject macro operation
>> > as I wish, but even if I accept it the auto-open macro hasn't run. Any
>> > ideas how to get round this? *I'm in unfamiliar territory with no
>> > previous experience of Win 7 and not much of Office 2007. *Have I just
>> > missed something simple?

>>
>> > I can't use self-signed certificates because the workbook will be used
>> > on more than one computer.

>>
>> > TIA * John

>>
>> --
>>
>> Dave Peterson- Hide quoted text -
>>
>> - Show quoted text -

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: 1st macro run then 2 macro is run Don Guillett Microsoft Excel Programming 0 16th Feb 2012 01:42 AM
Access Macro to export table to Excel then run Excel macro Craig Microsoft Access Macros 1 14th Mar 2009 03:44 AM
macro will not run with file.xls!macro.macro BillRobPV Microsoft Excel Discussion 2 12th Sep 2008 05:08 PM
Excel 2003 won't run simple code that Excel XP and Excel 2000 will run Moses Microsoft Excel Programming 4 27th Jan 2005 07:30 AM
Macro to run or not run a second Macro Darin Kramer Microsoft Excel Programming 2 2nd Dec 2004 05:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:56 PM.