Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default Opening Excel from Access

I think you must have tried already, but forgot to set Excel to visible.
Once you set it to visible all remaining code is same as in excel macros.
You can use below code.

Sub olExcelOpen()
Dim exApp As Excel.Application
Dim myBook As Excel.Workbook
Set exApp = CreateObject("Excel.Application")
exApp.Visible = True
Set myBook = exApp.Workbooks.Open(FileName:="Path to the file",
ReadOnly:=True)
myBook.RunAutoMacros xlAutoOpen
End Sub

Sharad

"Steve Price" wrote in message
...
Didn't know whether to post this here or under Access.

Basically, how do you open an Excel worksheet from Access in code?

Also, the Excel worksheet uses Macro's and is read only/protected. Is it
possible for the warnings to be surpressed? i.e. Instead of the user being
asked whether to allow macros, these are automatically allowed. And
instead
of accessing to enter password to modify workbook, 'read only' is
automatically chosen.


Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening an ACCESS db from the VBE in EXCEL Doctorjones_md Excel Discussion (Misc queries) 4 April 20th 07 07:35 PM
Opening an ACCESS db from the VBE in EXCEL doctorjones_md[_2_] Excel Worksheet Functions 0 April 20th 07 07:35 PM
Opening Access From Excel Kieron White Excel Discussion (Misc queries) 3 April 2nd 06 05:34 PM
Opening Access from Excel Cindy Excel Programming 4 January 14th 04 01:27 PM
Opening Excel via Access Dave[_32_] Excel Programming 1 October 21st 03 06:23 PM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"