By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,036 Members | 978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,036 IT Pros & Developers. It's quick & easy.

How to open spreadsheet from workbook

P: 1
Hi, i have this button within Access that opens a workbook in excel. I have this code.

Dim stAppName As String stAppName = "Excel.exe c:\workbook.xls" Call Shell(stAppName, 1)
What i want is to ad an command to open a specific spreadshhet within that workbook, how do i do that?
Feb 24 '08 #1
Share this Question
Share on Google+
2 Replies

P: 6
Hi what you need to do in your dim statement is specify the sheet name as follows:
Expand|Select|Wrap|Line Numbers
  1. dim wkbk as excel.application
  2. set wkbk = createobject("excel.application")
  3. with wkbk
  4. .visible=true
  5. ("The path and name of the workbook")
  6. .sheets("The name of the sheet to activate").select
  8. end with
Feb 24 '08 #2

Expert Mod 15k+
P: 31,769
Check out Application Automation.
Feb 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.