JPARKHURST
Board Regular
- Joined
- Oct 25, 2016
- Messages
- 151
Did I miss an update, something with excel or ...?
This code is (all stored in a module, save for the workbook_open):
has been working for months, and is now not working. "Run-time error 9" Subscript out of range
It is called here:
and it is called on doc open.
Here is the workbook variable set
I am at a loss. Any help or direction would be appreciated.
This code is (all stored in a module, save for the workbook_open):
Code:
Public Function CnSwS(wb101 As Workbook, ws101 As Worksheet, sws101 As String) 'Check to see if Worksheet variables have been established, and if not, establish them!
If ws101 Is Nothing Then
Set ws101 = wb101.Sheets(sws101) 'this is the line erring
End If
End Function
has been working for months, and is now not working. "Run-time error 9" Subscript out of range
It is called here:
Code:
Public Sub FireOpen()
'Check & See if things need to be reset
'Set wbThis = CnSwB(wbThis)
Call CnSwB(wbThis)
Call CnSwS(wbThis, wsDashboard, "Dashboard")
Call CnSwS(wbThis, wsWorkingDispatch, "Working_Dispatch")
Call CnSwS(wbThis, wsJobDispatch, "Job_Dispatch")
Call CnSwS(wbThis, wsShortages, "Shortages")
Call CnSwS(wbThis, wsShippingRequirements, "Shipping_Requirements")
Call CnSwS(wbThis, wsResprayReport, "Respray_Report")
End Sub
and it is called on doc open.
Code:
Public Sub Workbook_Open()
Call FireOpen
End Sub
Here is the workbook variable set
Code:
Public Function CnSwB(wb100 As Workbook)
'Check to see if Workbook is established, if not, establish it!
If wb100 Is Nothing Then
Set wb100 = ThisWorkbook
End If
'CnSwB = wb100
End Function
I am at a loss. Any help or direction would be appreciated.
Last edited: