LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Window Object - Subscript out of Range


I want to be able to use my macro for lots of different projects, so the
filenames that I use throughout the macro need to be easy to change.

So I've set them up at the beginning of the Macro so they're easy to
identify using the following sequence:

myPath = "U:\PM&E\09 Project Work\253 Kazakhstan Project\02 Project
Services\03 Man Hour Reports\"

mySourceFileBase = ActiveWorkbook.Worksheets("Imported
Data").Range("F5").Value

mySourceFile = myPath & mySourceFileBase

So I can put the file name that I want to import data from in the workbook
containing the macro and hopefully not have to open the VBE to alter the file
references.

and it's used it correctly in this line:

Workbooks.Open Filename:=mySourceFile

but after I've activated a different window, I can't get the syntax right
for activating the other window that mySourceFile refers to. It wants the
file name reference ("RF Man Hours Report 0506.xls").

Is there any way that I can use mySourceFile as a window object?
 
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
Subscript out of range Bruce001[_6_] Excel Programming 2 December 2nd 05 04:21 PM
Confusion about how the Window object fits into the Excel object model Josh Sale Excel Programming 11 April 15th 05 06:08 PM
Subscript out of range Bill Murphy Excel Programming 1 August 5th 04 08:52 AM
subscript out of range Todd Huttenstine[_3_] Excel Programming 1 June 11th 04 04:08 AM
Subscript out of range Stacy Haskins[_2_] Excel Programming 4 April 10th 04 05:41 AM


All times are GMT +1. The time now is 12:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"