Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I am working in workbook xxxxx, the code below is supposed to open
workbook yyyyy, copy an entire sheet from it, come back to workbook xxxxx, paste the copied data into a corresponding sheet in xxxxx (overwriting any previous contents), then shut down workbook yyyyy. However, the line that takes me back to workbook yyyyy so I can close it (I've set it off with ###########) is throwing a "subscript out of range" error -- this even though I know darn well that yyyyy exists, I just got done copying from it!! Any ideas on why and what I can do about it are most welcome. 'Get the most current HeadersnTitles data from HeadersnTitles.xls in c:\LOBTmplat\Template Workbooks.Open Filename:="C:\LOBTmplat\Template\HeadersnTitles.xl s" Cells.Select Selection.Copy Windows("Auto_PRISM_Lob.xls").Activate Sheets("HeadersnTitles").Select Cells.Select ActiveSheet.Paste Application.CutCopyMode = False ActiveWorkbook.Names.Add Name:="Titles", RefersToR1C1:="=HeadersnTitles!R3C1:R23C1" ActiveWorkbook.Names.Add Name:="DefaultHeaders", RefersToR1C1:="=HeadersnTitles!R1C2:R1C55" Sheets("Auto_PRISM_Lob").Select ########################################## Windows("HeadersnTitles.xls").Activate ########################################## ActiveWindow.Close |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Incorrectly getting "Subscript out of range" Error. | Excel Programming | |||
"Subscript out of range" error for: Workbooks("Test1.xls").Save | Excel Programming | |||
FileCopy Command Giving "Subscript Out of Range" Error Message | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming |