I have a COM object that has numerous properties which are set prior to calling one if its methods. I have been using the following code to open/start the COM object. This code does not work inside a Try Catch block.
Is there a better way than trying to catch the error if the GetObject fails.
I would like to find a way to create the object inside the Try Catch block. I was thinking of Process.Start but I could not get it to work.
Dim objWP as Object
On Error Resume Next
objWp = GetObject(, "WPProjectX.Class1")
If Err.Number = 429 Then
objWp = CreateObject("WPProjectX.Class1")
On Error GoTo 0
.Connection = "Servername, etc"
.LotNo = "XXXXXX"
s = .SpecSheet