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
|