Launching Excel from Access

Rendezvous

New Member
Joined
Feb 27, 2004
Messages
1
I noticed a similar posting in November, but I do have a more specific question. I know that I can launch excel from a line of code within Access, but is there a way to launch Excel hidden so that the user does not see Excel open, format a report, print it to a pdf and then close, returning to Access? If not, what's my next best choice, run this process minimized?

thanks in advance,
Doug
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Welcome to the board. :)

Normally when you open XL by code it is not visible unless you use code to make it visible so you should be OK.

HTH

Peter
 
Upvote 0
Here are some things to research for you. Obviously you don't have to use the object variable names, but I wanted to include the Declarations/Set commands as reference.


Code:
Dim objXL As Excel.Application
Dim objWkb As Workbook
Dim objSht As Worksheet
Dim strFile  As String

strFile = "path to file include drive designation"
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open(strFile)
Set objSht = objXL.Workbooks.Add(strFile)

objXL.Visible = True
objXL.DisplayAlerts = False
objXL.UserControl = True
objWkb.Close True, strFile
objXL.Quit

.Visible makes the Application visible
.DisplayAlerts is a method to suppress or enable xls dialog boxes
.Usercontrol - default is False, needs to be True to save changes and also before any .Close/.Quit methods

Mike
 
Upvote 0

Forum statistics

Threads
1,221,626
Messages
6,160,909
Members
451,677
Latest member
michellehoddinott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top