Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subscript out of range | Excel Programming | |||
Confusion about how the Window object fits into the Excel object model | Excel Programming | |||
Subscript out of range | Excel Programming | |||
subscript out of range | Excel Programming | |||
Subscript out of range | Excel Programming |