PC Review


Reply
Thread Tools Rate Thread

Change file ref in VBA

 
 
donh
Guest
Posts: n/a
 
      30th Nov 2006
Hi,

I have a large ish workbook and have created an index page to aid
navigation. I have also created additional menu items for users. One
of which is a link to the Index page. On testing I opened a new
workbook and the Index link generated an error. On checking added
Windows("test.xls").Activate to my Sub, and now users can navigate back
to the Index page from inside or outside of the workbook, which I'm
happy with.

My Sub

Sub Index()

Windows("test.xls").Activate
Sheets("Index").Select

End Sub

is kept in my test.xls workbook and the menu updated when opened and
items removed when closed.


My question is can I get VBA to check the xls file name (at present
test.xls) and change the Windows("test.xls").Activate to match if file
has been renamed.

Thanks for any help




DonH

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      30th Nov 2006
Try uisng ThisWorkbook.Activate

--
---

HTH

Bob

(change the xxxx to gmail if mailing direct)
"donh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a large ish workbook and have created an index page to aid
> navigation. I have also created additional menu items for users. One
> of which is a link to the Index page. On testing I opened a new
> workbook and the Index link generated an error. On checking added
> Windows("test.xls").Activate to my Sub, and now users can navigate back
> to the Index page from inside or outside of the workbook, which I'm
> happy with.
>
> My Sub
>
> Sub Index()
>
> Windows("test.xls").Activate
> Sheets("Index").Select
>
> End Sub
>
> is kept in my test.xls workbook and the menu updated when opened and
> items removed when closed.
>
>
> My question is can I get VBA to check the xls file name (at present
> test.xls) and change the Windows("test.xls").Activate to match if file
> has been renamed.
>
> Thanks for any help
>
>
>
>
> DonH
>



 
Reply With Quote
 
donh
Guest
Posts: n/a
 
      30th Nov 2006
Thanks Bob ,

Worked fine

DonH


Bob Phillips wrote:
> Try uisng ThisWorkbook.Activate
>
> --
> ---
>
> HTH
>
> Bob
>
> (change the xxxx to gmail if mailing direct)
> "donh" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I have a large ish workbook and have created an index page to aid
> > navigation. I have also created additional menu items for users. One
> > of which is a link to the Index page. On testing I opened a new
> > workbook and the Index link generated an error. On checking added
> > Windows("test.xls").Activate to my Sub, and now users can navigate back
> > to the Index page from inside or outside of the workbook, which I'm
> > happy with.
> >
> > My Sub
> >
> > Sub Index()
> >
> > Windows("test.xls").Activate
> > Sheets("Index").Select
> >
> > End Sub
> >
> > is kept in my test.xls workbook and the menu updated when opened and
> > items removed when closed.
> >
> >
> > My question is can I get VBA to check the xls file name (at present
> > test.xls) and change the Windows("test.xls").Activate to match if file
> > has been renamed.
> >
> > Thanks for any help
> >
> >
> >
> >
> > DonH
> >


 
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
File Icons change - cannot change back =?Utf-8?B?YmlubnNkcmFmdGluZw==?= Windows XP General 0 5th Sep 2007 11:20 PM
HOW DO I CHANGE A PDF FILE TO WORD SO THAT I CAN CHANGE FONT ETC? =?Utf-8?B?UEFTNDcwNg==?= Microsoft Powerpoint 1 11th Oct 2006 09:53 PM
How do I change Word file locations after network change =?Utf-8?B?YWRyaWVubmVsYW1i?= Microsoft Word Document Management 1 3rd Aug 2005 05:36 PM
Save the same file to different location - Change one, Change all =?Utf-8?B?Q2F0aHkgUiBIamVsbQ==?= Microsoft Word Document Management 2 16th Nov 2004 04:12 PM
How to change mdw file to reflect a change in shared folder name? Fook-Loon Wong Microsoft Access Security 1 24th Nov 2003 11:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 PM.