ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Controlling EXCEL on open properties (https://www.excelbanter.com/excel-programming/323449-controlling-excel-open-properties.html)

wtpcomplab

Controlling EXCEL on open properties
 
Im having problems getting the programming correct using an Access Form as a
front end to open an Excel Workbook. The workbook is already is in place, but
the customer wants Access for the front end.
My problem is I cant figure out how to set the "on open properties" for the
workbook.
I need to have the have a worksheet open maximized, and I want to hide all
toolbars.

Below is the code I have set to call Excel.
I have used the send keys to answer the system message about opening a
hyperlink.



Private Sub Command0_Click()

Dim xlApp As Object
Dim FleNme As String
FleNme = "L:OFFICE SKILLS\FRONT END - DATA ENTRY.xls"
Set xlApp = CreateObject("Excel.Application")
SendKeys "{LEFT}{ENTER}"
'xlApp.Open "L:OFFICE SKILLS\FRONT END - DATA ENTRY.xls"
Set xlApp = Nothing ' set the reference to nothing

End Sub


NickHK

Controlling EXCEL on open properties
 
wtpcomplab,
You would probaly find it easier to use early binding (i.e. setting a
reference to the Excel library) and benfit from Intellisense. Then:
Dim xlApp as Excel.Application
dim xlComBar as Excel.CommadBar

Set xlApp=New Excel.Application
With xlApp
.DisplayAlerts=False 'If needed
For Each xlComBar In .CommandBars
xlComBar.Visible=False

......Other processing

The easiest way to get an idea of the Excel code is to record a macro of
your desired actions, view the generated code and edit as necessary for the
VB environment.

NickHK

"wtpcomplab" wrote in message
...
I'm having problems getting the programming correct using an Access Form

as a
front end to open an Excel Workbook. The workbook is already is in place,

but
the customer wants Access for the front end.
My problem is I can't figure out how to set the "on open properties" for

the
workbook.
I need to have the have a worksheet open maximized, and I want to hide all
toolbars.

Below is the code I have set to call Excel.
I have used the send keys to answer the system message about opening a
hyperlink.



Private Sub Command0_Click()

Dim xlApp As Object
Dim FleNme As String
FleNme = "L:OFFICE SKILLS\FRONT END - DATA ENTRY.xls"
Set xlApp = CreateObject("Excel.Application")
SendKeys "{LEFT}{ENTER}"
'xlApp.Open "L:OFFICE SKILLS\FRONT END - DATA ENTRY.xls"
Set xlApp = Nothing ' set the reference to nothing

End Sub





All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com