variant type

  • Thread starter Thread starter Deborah
  • Start date Start date
D

Deborah

Ok I have the start of a function as
Function GetLinkedPath(objOLE as Variant) as variant
dim strChunk as string

The following line of code gets the type mismatch error:
strChunk = StrConv(objOLE, vbUnicode)

Why? And what can I do to fix it. Since objOLE is a
variant shouldn't StrConv just work with it?

Deborah
 
As far as I can tell, it should work *if* objOLE contains a value that can
be converted to a string. I would expect it to fail if objOLE contains a
value that can not be converted to a string.

What value does objOLE contain when the function fails?
 
That's the whole problem. I am trying to find the path of
an OLE object (hence the name) and don't know what it has
been saved as. Mind you, this chunk of code comes from
Microsoft for solving just this problem which makes it
very exasperating! And I am trying on their Northwinds db.
Sigh.

Deborah
 
That's the whole problem. This line of code comes from a
Microsoft program to help me find the path of an OLE
object. I don't know how Access stores paths of OLE
objects. This piece of code didn't work for the Nortwinds
db, so I am trying to figure out what I could change.

Deborah
 
It's difficult to help without seeing the code, Deborah. If you got the code
from a KB article or similar, post the URL and I'll have a look.
 
What program?

--
Brendan Reynolds (MVP)

Deborah said:
That's the whole problem. This line of code comes from a
Microsoft program to help me find the path of an OLE
object. I don't know how Access stores paths of OLE
objects. This piece of code didn't work for the Nortwinds
db, so I am trying to figure out what I could change.

Deborah
 
Back
Top