Open a file On_Click from a set location

hollarindy

Registered User.
Local time
Today, 04:43
Joined
Nov 16, 2012
Messages
33
Hopefully this is quick and easy. I cannot find code that will let me open an exsisting excel workbook. Instead of recreating the wheel for this project it is just easier if I can tie an exsisting excel product to my data base. I want the button to function like a hyper link to open the file.

I've tried .Hyperlink.Follow and Application.workbooks.Open neither of which I can get to work. Any ideas? The fact that the excel workbook is on a network location shouldn't make it function any different right?
 
Instead of recreating the wheel for this project it is just easier if I can tie an exsisting excel product to my data base.

What does this bit mean exactly?

Are you trying to launch an instance of Excel with a specific filename from an Access database?

From another Excel spreadsheet which you are calling a "data base"?
 
What does this bit mean exactly?

Are you trying to launch an instance of Excel with a specific filename from an Access database?
What I meant by that bit is that I had an idea of creating a data input module for my Access databasethat would essentially accomplish the same thing as the spread sheet one of my counter parts already created.

Yes, I am trying to launch a spacific Excel file from my Access database. I want the button to function like a hyperlink.
 
Yes, I am trying to launch a spacific Excel file from my Access database. I want the button to function like a hyperlink.

In that case, I would suggest simply placing in the button's Click() event behavior to launch the spreadsheet file as if it were an executable file, allowing Window's file association to look up the correct executable path to process the file based on the file's extension.

You need to decide if you want the Access VBA event to wait until Excel has exited or not. If you do, then here is the link to what you will need:

ShellAndWait which actually works, returns the program's Exit Code, WindowStyle spec
http://www.access-programmers.co.uk/forums/showthread.php?t=237688

If you want Access not to care when Excel exits, then simply make a call to the VBA Shell function. Look that up in the VBA reference.
 

Users who are viewing this thread

Back
Top Bottom