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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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