-
Open Excel sheet from Access
[Originally posted by Jack]
I want to open a specific excel file from a command button on an Access 97 form, I would be grateful for any advice. Thanks
-
Re:Open Excel sheet from Access
[Originally posted by Santiago Linero]
A way to do it is using "Shell"
Shell ("excel.exe <complete path to file>.xls")
-
Re:Re:Open Excel sheet from Access
[Originally posted by Jack]
I hate to sound thick but I am quite new to vba, due you think you could give me an example??? cheers Jack
-
Re:Re:Re:Open Excel sheet from Access
[Originally posted by Santiago Linero]
All right, you've got your Command Button in Access 97, and you're in design view. Right-click the button and select "Event" tag, "on-click" option. There you click the "..." button and the form code should appear. The code you need is:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
ÿ ÿ Dim oApp As Object
Shell ("excel.exe C:\XX\Numbers.xls")
Exit_Command8_Click:
ÿ ÿ Exit Sub
Err_Command8_Click:
ÿ ÿ MsgBox Err.Description
ÿ ÿ Resume Exit_Command8_Click
ÿ ÿ
End Sub
Replace Command8 with your button name and the path and file name with yours.
-
Re:Re:Re:Re:Open Excel sheet from Access
[Originally posted by Jack]
Cheers, thanks a lot I will give that a go. Jack
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks