X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Runtime Error 9 Subscript Out Of Range, Office 2010    
post Nov 7 2019, 12:25 PM

Posts: 1
Joined: 7-November 19

Apparently a recent windows update at my work location has caused issues. One of our modeling tools is having an issue when it gets to the end where it’s trying to transfer data from one excel file to another. I’m getting the Runtime 9 Subscript out of range error.

A coworker of mine had this same issue back in February and I found a fix he made, but even that isn’t working now. Within the last week, I am getting the same error again and I can’t find any reason I should be getting it.

I have checked to make sure the file location, workbook and sheet names are correct. It can open the file but when it goes to assign the sheet names it can’t find them. It almost acts like it is opening the workbook in a separate instance of excel.

If I activate the workbook, it will find the sheets, but then I still receive the error after the fact.

Do you know any other reason why I could be getting this error?

'Set m_wkbIntermedOutputs = Application.Workbooks.Open(m_sDestFolder & "\Intermediate Files\" & vFileName) – Prior to 2/26/2019
Set m_wkbIntermedOutputs = Application.Workbooks.Add(m_sDestFolder & "\Intermediate Files\" & vFileName) 'FIX TO CORRECT SUBSCRIPT OUT OF RANGE ERROR GRH 2/26/2019
'Application.Windows(m_wkbIntermedOutputs.Name).Visible = True
Application.Windows(m_wkbIntermedOutputs.Name).Visible = False

programCount = programCount + 1

Set wkLCOCurrent = m_wkbIntermedOutputs.Worksheets("Optimal-Current - Detail") <---Here is where I get the error.
Set wkLCOTop3 = m_wkbIntermedOutputs.Worksheets("Top3 - Detail")
Go to the top of the page
post Nov 7 2019, 03:26 PM

Posts: 7,112
Joined: 22-December 10
From: England

Yhe message usually means that it can't find that worksheet.

Have you checked that that sheet is in that workbook, by single stepping the program
And have you checked for a trailing space in the sheet name..
Could you also post the DIMS for those objects?
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    14th November 2019 - 07:48 PM