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!

Open an existing Excel file using cmd button 2

Status
Not open for further replies.

DaMorf

Technical User
May 11, 2006
10
GB
Hi,

I am attempting to write code into a button that will open an existing excel file that i have created.

i can output data to a file but cannot seem to just open it?

Any idea's?

Many thanks,
 
Two common ways:
1) FollowHyperlink
2) GetObject

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH, thanks for your reply.

How would i incorperate that into the command, do you have an example code?

Thanks
 
What have you tried so far ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I am trying to add it into an existing button that executes a macro, i am new to VBA so am not sure what kind of code would be required, all i have tried to use so far are docmd functions.

i assumed that i would put in the function followed by the filepath, probably a bit naive!!!

FollowHyperlink "\\t001dfsd3.axa-uk.intraxa\shared3\union_a_sales\planning\Team\(7) Andrew Morfey\Payroll DB Excel Download Files\ExpWholeFormatted"


Thanks,
 
Hi!

You don't need code, just put the path in the hyperlink property of the button and the file will open.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
That's done it!!

Thanks both for replies!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top