Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error while moving sheet
Hello;
I'm getting Run-time error '9': Subscript out of range with this code on line with *. Dim FName As String FName = BP & "-" & EP & ".xls" Path = "C:\TS\" If Not FileExists(FName) Then ActiveWorkbook.SaveAs FileName:=Path & FName, _ FileFormat:=xlNormal, Password:="++++", WriteResPassword:="++++" ActiveWorkbook.Close Else Workbooks.Open FileName:=Path & FName, Password:="++++", WriteResPassword:="++++" ActiveWindow.ActivateNext * Sheets(1).Move After:=Workbooks(" & FName & ").Sheets(Sheets.Count) ActiveWorkbook.Close (True) End If When I enter actual file name it is fine. PLease help, Irek |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula for moving information from one sheet to another sheet | Excel Discussion (Misc queries) | |||
moving from one sheet to another from a cell of a sheet | Excel Worksheet Functions | |||
moving informatiion from one sheet to a total sheet | Excel Discussion (Misc queries) | |||
Error when moving sheet | Excel Programming | |||
Error when moving sheet | Excel Programming |