PC Review


Reply
Thread Tools Rate Thread

Creating Automation Objects

 
 
Mike Collard
Guest
Posts: n/a
 
      7th Jul 2004
I have copied some code from MS Help to open an MS Excel
spreadsheet, MySpread.xls, manipulate it and then close
Access.

The following lines are included in the code:

..Application.Visible = True
..Parent.Windows(1).Visible = True

I have a Personal.xls spreadsheet that is normally hidden
but it is counted in the index as 1 so to activate my
chosen spreadsheet I renumbered the above
to .Parent.Windows(2).Visible. But that only works if no
other spreadsheets are open.

How can I change the code so that MySpread.Xls is opened
and made visible i.e. becomes the active sheet, regardless
of how many other spreadsheets are open?

Thanks
 
Reply With Quote
 
 
 
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      7th Jul 2004
Mike,

..Parent.Windows("MySpread.xls").Visible = True

should do it.

HTH,
Nikos

"Mike Collard" <(E-Mail Removed)> wrote in message
news:27e0901c46400$c5c69540$(E-Mail Removed)...
> I have copied some code from MS Help to open an MS Excel
> spreadsheet, MySpread.xls, manipulate it and then close
> Access.
>
> The following lines are included in the code:
>
> .Application.Visible = True
> .Parent.Windows(1).Visible = True
>
> I have a Personal.xls spreadsheet that is normally hidden
> but it is counted in the index as 1 so to activate my
> chosen spreadsheet I renumbered the above
> to .Parent.Windows(2).Visible. But that only works if no
> other spreadsheets are open.
>
> How can I change the code so that MySpread.Xls is opened
> and made visible i.e. becomes the active sheet, regardless
> of how many other spreadsheets are open?
>
> Thanks



 
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
Add-In, Automation objects, CDO, or MAPI? Jordan Hafer Microsoft Outlook Program Addins 1 20th Jul 2008 05:08 PM
RE: Automation Objects =?Utf-8?B?RGVyZWsgV2l0dG1hbg==?= Microsoft Access VBA Modules 0 8th Nov 2004 08:19 PM
Re: Automation Objects John Nurick Microsoft Access VBA Modules 3 23rd Jul 2004 10:10 PM
Automation objects Alain Microsoft Access VBA Modules 3 14th Jul 2004 11:12 PM
Automation Error w/ Objects Trent Argante Microsoft Access Macros 7 8th Nov 2003 04:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 AM.