Mid Function with XlInsertObject Hlp!

J

Joyce

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.
 
P

Patrick Molloy

try using this method instead

chDrive = "C"
chDir = "C:\temp"
sFileName = Application.GetOpenFilename()
 
J

Joyce

Hi Patrick,
Thanks for your response. Unfortunately, I couldn't get that to work. I
get an error message - Path Not Found on the line with chDir "C:temp"

Dim SFileName As String
ChDrive "C"
ChDir "C:\temp"
SFileName = Application.GetOpenFilename()
 
P

Patrick Molloy

well of course not. you need to point where your files are. That was my
example, plus you need the '\'
 
J

Joyce

Hi Patrick,

Sorry for my lack of skills. I'll keep trying.

This will be on different computers, but I'd like the dialog box to simply
open into My Documents. The users can navigate from there.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top