Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As a temporary fix to my larger problem so I can at least get the macro
in the system, I have put together this code. My problem is, I am getting a Runtime Error 9: Subscript Out of Range on the Windows(UF).Activate portion. Shouldn't I be able to reference a variable I have defined earlier in a function like this? Also, am I asking for trouble with the Kill function set up like it is? Dim UF As Variant Dim UFOld As Variant UF = Application.GetOpenFilename(FileFilter:="XML Files (*.xml)", Title:="This Weeks Projections for Marc") Workbooks.Open Filename:=UF Sheets("Marc").Select Sheets("Marc").Copy After:=Workbooks("Projection Summary.xls").Sheets("Summary") Windows(UF).Activate ActiveWindow.Close UFOld = Application.GetOpenFilename(FileFilter:="XML Files (*.xml)", Title:="Last Weeks Projections for Marc") Workbooks.Open Filename:=UFOld Sheets("Marc").Select Sheets("Marc").Name = "Marc Last Week" Sheets("Marc Last Week").Copy After:=Workbooks("Projection Summary.xls").Sheets("Marc") Windows(UFOld).Activate ActiveWindow.Close Kill (UFOld) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subscript out of Range | Excel Discussion (Misc queries) | |||
what does 'Subscript Out of range' mean?? | Excel Worksheet Functions | |||
9: Subscript out of range | Excel Discussion (Misc queries) | |||
SubScript Out Of Range. | Excel Programming | |||
Subscript Out of Range | Excel Programming |