Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I have been trying to fix this error but I have no clue why it's not
working. Any help would be greatly appreciated! I am getting "Subscript out of range error" when I execute the coding given below, only when I HAVE AN EXCEL INSTANCE OPEN. If I close all the excel instance and run the code again, it works just fine. Here is the coding: ------------------------------ Dim xlsApp As Object 'I included this ExcelIsOpen function to see if an excel instance is already open 'and if so, use that...but that doesn't seem to fix the issue If ExcelIsOpen Then Set xlsApp = GetObject(, "Excel.Application") xlsApp.Visible = True Else Set xlsApp = CreateObject("Excel.Application") xlsApp.Visible = True End If xlsApp.Workbooks.Open Filename:="C:\USERNAME\Import_UnmappedMoves.xls", Password:="password", WriteResPassword:="password" 'am getting the error when the next line executes Workbooks("Import_unmappedmoves.xls").worksheets(" Moves").Activate ------------------------ Do you know where I am going wrong? Thanks in advance for your help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error - Subscript out of range despite On Error statement | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Type Mismatch error & subscript out of range error | Excel Programming | |||
subscript out of range error | Excel Programming |