I have written the following routine:
Public Function fPathToOle(strDocPath As String) As Object
Dim objDocument As Object
On Error GoTo ErrfPathToOle
Set objDocument = GetObject(strDocPath)
Set fPathToOle = objDocument
ExitfPathtoOle:
Exit Function
ErrfPathToOle:
Resume ExitfPathtoOle
End Function
Thru stepping into each statement using the debugger, I found that the module errs on the statement "Set objDocument = GetObject(strDocPath)". The Err.Description is "Object required". At the time this happened, strDocPath was "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\sunset.jpg", a valid pathname to a file.
What am I not doing correctly here.
sjl
Start Free Trial