I have an excel 2013 macro workbook.
This workbook has been working fine for the last 6 months. The first day this year I had an issue below with line of code below. All this line of code did was to set the activex checkbox control to true when the workbook is opened.
Sheets(WSCHARTS).chkAllJPM.value = True
I manage to fix the issue through a previous post. The answer was by following the instructions. However a team member who is back in the office for their first day is having issues with this workbook. Again they have been using this workbook daily without any issues. The code debugs on the same line above with the error code number 32809.
I tried following the same instructions that fixed the issue for me but no joy. I cannot replicate the issues on my computer. Not sure what is causing this error?
Here is the sub routine. Please note WSCHARTS is public const string - its value is "charts"
Sub SetDefaultSetting()
' set the default view upon opening the spreadsheet
Dim ws As Worksheet
Dim wsTime As Worksheet
Set wsTime = ThisWorkbook.Sheets(WSTSJPM)
Set ws = ThisWorkbook.Sheets(WSCHARTS)
' get last date
Dim lRow As Long
lRow = wsTime.Range("A65536").End(xlUp).Row
ws.DropDowns("DropDownStart").ListFillRange = wsTime.Name & "!" & wsTime.Range("A2:A" & lRow).Address
ws.DropDowns("DropDownEnd").ListFillRange = wsTime.Name & "!" & wsTime.Range("A2:A" & lRow).Address
ws.Range(COLDATES & "1") = 1 ' start date is 12 dec 2013
ws.Range(COLDATES & "2") = lRow - 1 ' latest avaiable date
' control are linked to cells so just need to change their cell values
ws.Range("C1") = 6
ws.Range("D1") = 7
ws.Range("E1") = 8
ws.Range("F1") = 9
ws.Range("G1") = 10
' rest should be blank
ws.Range("H1") = 1
ws.Range("I1") = 1
ws.Range("J1") = 1
ws.Range("K1") = 1
ws.Range("L1") = 1
Sheets(WSCHARTS).chkAllJPM.value = True
ws.OLEObjects("chkBOAML5").Object.Enabled = False
Set wsTime = Nothing
Set ws = Nothing
UPDATE
So I created a new workbook and just place a single activex checkbox control on Sheet1 & renamed it chkTest.
I added the code below. The code works on my PC but not on my colleagues computer. This is rather frustrating now. Any ideas?
Private Sub Workbook_Open()
Sheets("Sheet1").chkTest.Value = True
End Sub
Another Update
Not sure if this has anything to do with my issue. When I follow the instruction mentioned earlier I did notice in my c:\users\username\Appdata\local\Temp\VBE directory I had an extra file which my colleague did not have.
I had a MsForms.exd and RefEdit.exd. My colleague only had the MsForms.exd file. Could this cause any issues?
Hopefully my last update
So changing the code above in the update directly above this to the code below it now works on both our computers. Is anyone able to explain why or what the difference is?
Private Sub Workbook_Open()
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
ws.OLEObjects("chkTest").Object.Value = False
End Sub