ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save, Save As, Print Grayed Out when instance created via VBA/VB6 (https://www.excelbanter.com/excel-programming/277734-re-save-save-print-grayed-out-when-instance-created-via-vba-vb6.html)

jaf

Save, Save As, Print Grayed Out when instance created via VBA/VB6
 
Hi Mike,
You dealing with two Excel objects.
The workbook the code is running in (thisworkbook) and xapp.

If you want xapp to become visible use its object prefix...
xapp.application.visible=true

If you want xapp to open a wb, again use the prefix
xapp.Workbooks.Open "C:\Test"

Otherwise thisworkbook will receive the instruction.


--

John

johnf202 at hotmail dot com


"Mike Williams" wrote in message
...
When creating an instance of Excel XP or 2000 via the
following:

Dim xapp As Excel.Application

Set xapp = CreateObject("Excel.application")
Excel.Application.Visible = True
Workbooks.Open "C:\Test"

The .XLA and .XLL files that are normally loaded during
the launch process are not loaded and the Save, Save As,
and Print menu items are unavailable.

In other words, if the shortcut to launch Excel or an icon
representing an Excel document is double-clicked all
macros and files in the XLStart directory are loaded
correctly. When launching them programmatically, they
appear not to load and the Save, Save As and Print menu
options under File are grayed-out.

Thoughts, commments, ideas....

Thank you,

Mike Williams





All times are GMT +1. The time now is 02:33 AM.

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