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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically opening Microsoft Excel using Access 2

Status
Not open for further replies.

dleiba

MIS
Aug 22, 2001
28
0
0
JM
Hey guys,

Yet another question to hopefully challenge the brain.

I know it is possibly to open an Excel workbook from within access using the Shell() command.

However, I do not want the user to have access to the default menus and toolbars available in Microsoft Excel.

1) Is there a way to programmatically disable these menus and toolbars for that specific workbook file from within Access?

2) If not, is it possible to open the spreadsheet in a window from within Access (showing only the spreadsheet and no menus or toolbars)?

Once again, any help would be greatly appreciated!

Thanks
 
Hi.

Check out CreateObject(). oddly enough, it has a heap of examples and explanations!
Your code can run Excel by itself.

eg:
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")

alternatively there is an activeX control called:
Microsoft Office Spreadsheet 9.0
This control inserts a spreadsheet control into your
access form.

Gzep, SOF
 
Gzep,

Thanks for your response.

I tried the ActiveX Control method you suggested and inserted a spreadsheet control on my form.

The concept is exactly what I was looking for.

I have one question however.

The ActiveX Control brings up a NEW spreadsheet. How do I reference an EXISTING spreadsheet and display it in a similar fashion?

Please let me know...Thanks once again!

Dominic Leiba
 
Look at the object browser for the Excel object.
That's how I learn a lot about how to control Excel, or other ActiveX objects.
 
There's Create and Get. You want to use the GetObject method.

Note, make sure you set reference the MS Excel 8.0 (or 9) object library or the properties and methods won't be available in the VBE. Tools/References from the VBE

Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top