Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have oBP declared publically as an object.
This code sets it ..
But when it reaches this code to use is it, I get an error (red line) "Object variable or WIth Block variable not set." It appears to be caused because oBP is empty.
Any thought on what needs to be corrected?
This code sets it ..
Rich (BB code):
Private Sub tglb_cue_gm_Click()
With Me
Set oBP = .tglb_cue_gm
sRPT = "CUE-GM.docx"
button_check ' oBP, sRPT
End With
End Sub
But when it reaches this code to use is it, I get an error (red line) "Object variable or WIth Block variable not set." It appears to be caused because oBP is empty.
Rich (BB code):
Sub button_check() '(ByVal oBP As Object, sRPT As String)
'oBP = userform toggle button name (from toggle button click event)
'sRPT = report (.docx) filename (from toggle button click event)
If bpb = 0 Then 'bypass if bypass flag = 1
With uf4_works 'the userform
With oBP
'this allows a previouly created report to be viewed.
If .BackColor = RGB(0, 153, 211) And .Value = True Then
If DocOpen(sRPT) = False Then
Set WordApp = CreateObject("word.Application")
WordApp.Documents.Open path_name & sRPT
WordApp.Visible = True
Set WordApp = Nothing
.Value = True
End If
...
Any thought on what needs to be corrected?
Last edited: