Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
This should be pretty basic, but my code below doesn't seem to be triggering.
This code is in the ThisWorkbook object of the workbook opened.
I have a stop command in this code, but when I open the workbook, this line isn't reached. If the code was triggered, it should stop with this command.
The other weird thing, a relatively small workbook takes a noticeably long time to open (in terms of milliseconds). I have much larger workbooks that open seemingly instantly.
Thoughts?
This code is in the ThisWorkbook object of the workbook opened.
Rich (BB code):
Private Sub Workbook_Open()
Set wb_dia = Workbooks("Diamond_Test.xlsm")
Set ws_template = wb_dia.Worksheets("template")
Set ws_lists = wb_dia.Worksheets("lists")
Set ws_front = wb_dia.Worksheets("front")
Set rngTemp = ws_template.Range("B1:AB44")
Set rngSvc = ws_lists.Range("A2:C59")
Set rngFac = ws_lists.Range("E1:E" & ws_lists.Cells(ws_lists.Rows.Count, "E").End(xlUp).Row)
Set rngFac3 = ws_lists.Range("E1:G" & ws_lists.Cells(ws_lists.Rows.Count, "E").End(xlUp).Row)
svcCnt = 0
svcRid = 0
mbevents = True
Stop
With ws_front
.Activate
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
.Unprotect
With ws_front.Range("J3:BM1102")
.Clear
For Each shp In .Parent.Shapes
If Not Intersect(shp.TopLeftCell, .Cells) Is Nothing Then shp.Delete
Next shp
End With
mbevents = False
.Range("A1") = "Enter Date"
.Range("A2") = Format(0, "00000") 'date serial
.Range("D2") = Format(0, "000") 'record
.Range("E2:F2").Locked = True
.Range("E2") = svcRid
.Range("G2") = svcCnt
mbevents = True
.Protect
End With
End Sub
I have a stop command in this code, but when I open the workbook, this line isn't reached. If the code was triggered, it should stop with this command.
The other weird thing, a relatively small workbook takes a noticeably long time to open (in terms of milliseconds). I have much larger workbooks that open seemingly instantly.
Thoughts?
Last edited: