Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jeff,
Try Windows(InvFileName & ".xls").Activate Best Regards Bill -----Original Message----- HI, I am using the code below , but when it gets to; Windows(InvFileName).Activate ; it debugs and says; "Run time error 9, Script out of range. I ran this at home and it worked OK, but at work it crashes. At home i have a laptop with MS Millenium on it. At work I have Windows 98. Does this have anything to do with it ?? Note that InvFileName and NewFolder are both "Public" variables, but declared in a different module. Thanks in advance for any help. Jeff Sub SaveInvAsNewFile() 'name of new folder NewFolder = Format(Now, "yy-mm-dd") & " Invoices" 'Call the name as the text in cell z18 InvFileName = Sheets("InvoiceForm").Cells(18, 26) 'Opens new spreadsheet Workbooks.Add On Error Resume Next ActiveWorkbook.SaveAs Filename:="N:\Invoices\" & NewFolder & "\" & InvFileName & ".xls" On Error GoTo 0 Windows("Generate Report and Invoices.xls").Activate Range("A1:L59").Select Selection.Copy Windows(InvFileName).Activate 'THIS IS THE LINE THAT DEBUGS. . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cycle time out of range error | Excel Discussion (Misc queries) | |||
Run time error 9 : Subscript out of range | Excel Discussion (Misc queries) | |||
How do you sum a range of more than 30 cells. I get error each time I try. | Excel Worksheet Functions | |||
Run time error '9' Subscript out of range | Excel Programming | |||
Run time error 9 (subscript out of range) | Excel Programming |