Common Dialog Box

P

pat

I'm trying to program a macro using VBA in Excel 97 SR-1.

I've included a common dialog box control that opens the directory tree so
the user can pick a file.
This works fine on my machine but when I send the spreadsheet to others
users they get an error saying that the dialog box can't be created.

When I try to include a dialog box to the spreadsheet from their computer, I
get a "Cannot insert object" error. When I try to put a cdb on a UserForm in
the spreadsheet on a user machine, I get a License error.

I've tried registering the .dll and .ocx involved using regsvr32. I'm not
sure if a guid is wrong or a license key in the registry is wrong or what.
I'm not really sure where to look in the registry for the license key.

What I don't understand is why I can't include this control from their
computer? The common dialog control is checked under the 'References'
section. I should be able to re-create the macro from a user machine without
running into the licensing issue, right?

Anyone have any thoughts on how I could get around this problem?
 
T

Tom Ogilvy

it is easier to use

fname = Application.GetOpenfileName( ... see arg list in help )

Which puts up the standard file open dialog and returns a string (or array
of strings if multiselect = true) of the file(s) selected by the user. It
does not open the files. You use the string (array) to then open the files.

There is also an Application.GetSaveAsFilename

Regards,
Tom Ogilvy
 
P

pat

Excellent! Thanks a lot, Tom.


Tom Ogilvy said:
it is easier to use

fname = Application.GetOpenfileName( ... see arg list in help )

Which puts up the standard file open dialog and returns a string (or array
of strings if multiselect = true) of the file(s) selected by the user. It
does not open the files. You use the string (array) to then open the files.

There is also an Application.GetSaveAsFilename

Regards,
Tom Ogilvy



computer, UserForm
 

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