Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Establish File Association via VBA

Status
Not open for further replies.

dar149

MIS
Mar 5, 2002
117
US
I have a hyperlink in an Excel Spreadsheet. The hyperlink goes out to an electronic drawing and then opens a viewer which allows the drawing to be displayed. If I install the viewer to the pc, the association between the file and the program is established. However, I have the viewer loaded on a cd, and it will not be installed to a hard drive. So when I click on the hyperlink, it doesn't associate the file with the program.

Does anyone know of a way to establish an association with a file when the program is not installed to the pc???

Thanks in advance...
Debbie
 
It looks to me that your code is eventaully using an exe to open the file.

What you want to do is open a file in a program that does not exist.

Some programs provide a "reader" program such as "Adobe reader" for pdf files.

But even then the reader would have to be physicaly installed on the user machine.

But if you can open these files using a windows app such as paint or MS Photo editor, then you might be able to write code that makes the association via. an edit to the system registry.

I've seen this done, but I do not have a real example to post :-( ...

but at least I think I've got you on the right path.

that is if you can open these files with a windows supplied app.

 
Hi Debbie,

You must have an association established before you can open the file but it can be with an application on a removable device if that is what you want.

You only need to set up the association once and it might be easiest to do it manually via Windows Explorer options (I can't imagine you having to do lots of these for something that is only on CD). If you want it is possible to create the registry entries from VBA but I'd be very careful. I haven't done it but I'd be happy to try and knock up some code if you want.

Enjoy,
Tony
 
Thanks for the Info... I hesitate to create registry entries since the operating system could be 98, 2000, XP or NT. The viewer I'm using can be distributed freely, so I think I'll have them install the viewer first, then run the program I've created.

I appreciate the quick response...

Debbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top