Howard Kaikow
2006-09-08 19:09:24 UTC
I'm trying to Add a file in an add-in but I get error 91: Object variable or
With block variable not set.
What am I doing wrong? frmReadFile.frm is not already in the project.
Public VBInstance As vbide.VBE
Dim vbComp As vbide.VBComponent
Dim strUserform As String
On Error Resume Next
strUserformPath = App.Path & "\" & "frmReadFile.frm"
MsgBox "3: " & strUserformPath
Set vbComp =
VBInstance.ActiveVBProject.VBComponents.AddFile(strUserformPath)
MsgBox "DEBUG 3: " & Err.Number & ": " & Err.Description
With block variable not set.
What am I doing wrong? frmReadFile.frm is not already in the project.
Public VBInstance As vbide.VBE
Dim vbComp As vbide.VBComponent
Dim strUserform As String
On Error Resume Next
strUserformPath = App.Path & "\" & "frmReadFile.frm"
MsgBox "3: " & strUserformPath
Set vbComp =
VBInstance.ActiveVBProject.VBComponents.AddFile(strUserformPath)
MsgBox "DEBUG 3: " & Err.Number & ": " & Err.Description