Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Noemi
 
Posts: n/a
Default activate opened workbook via VBA

Hi
We have entered the attached code into a workbook (Testing Stores.xls) but
when we run the code it does not perform the task below.

Windows("Store Response List " & stDate).Activate

which is meant to activate workbook Store Response List (date).xls so we can
update the file.

The stDate is the date which is provided from a cell found in workbook
(Testing Stores.xls).

For some reason when it comes to this code it jumps back to the begining and
does not activate the required workbook.

I beleive it has to do with the stDate which I dont know how to get araound.

Any help would be greatly appreciated.

Thanks
Noemi
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default activate opened workbook via VBA

What is stDate?

Is it declared as a String or a Date?

Maybe...

Windows("Store Response List " & format(stDate,"mm_dd_yyyy")&".xls").Activate
or
workbooks("Store Response List " & format(stDate,"mm_dd_yyyy")&".xls").Activate

would work.

I added the .xls extension, too.



Noemi wrote:

Hi
We have entered the attached code into a workbook (Testing Stores.xls) but
when we run the code it does not perform the task below.

Windows("Store Response List " & stDate).Activate

which is meant to activate workbook Store Response List (date).xls so we can
update the file.

The stDate is the date which is provided from a cell found in workbook
(Testing Stores.xls).

For some reason when it comes to this code it jumps back to the begining and
does not activate the required workbook.

I beleive it has to do with the stDate which I dont know how to get araound.

Any help would be greatly appreciated.

Thanks
Noemi


--

Dave Peterson
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
How to refenence ranges on a closed workbook GjArt Excel Discussion (Misc queries) 4 November 29th 05 03:49 PM
How do I protect a worksheet from being opened inside a workbook J. Robinson Excel Discussion (Misc queries) 2 June 1st 05 03:40 PM
How to hyperlink from a workbook to sheets in another workbook? MJOHNSON Excel Worksheet Functions 0 February 17th 05 08:31 PM
Unprotect Workbook Kent Excel Discussion (Misc queries) 1 February 4th 05 01:07 AM
Can macro/userform run depending on HOW workbook is opened? grasping@straws Excel Discussion (Misc queries) 1 December 28th 04 03:19 PM


All times are GMT +1. The time now is 09:57 AM.

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"