Working For months, now broken

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):

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:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top