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

Open Excel Maximized from command button

Status
Not open for further replies.

DomFino

IS-IT--Management
Jul 9, 2003
278
0
0
US
Hi everyone,
I have a question about command Shell. I have a command button on an Access 2003 form. The code on the on click event works but Excel does not open maximized. I only get a excel icon on the toolbar showing Excel is open. When I click the toolbar icon, the correct Excel file is there. Is there a way to have the Excel form open maximized?


Code:
Private Sub cmdOpenExcel_Click()
On Error GoTo Err_cmdOpenExcel_Click
Dim retVal As Variant

retVal = Shell("Excel " & Chr(34) & "\\bigguy\users\dom_f\Access\TestWebPAS2\TESTwebpas_download.xls" & Chr(34))

Exit_cmdOpenExcel_Click:
    Exit Sub

Err_cmdOpenExcel_Click:
    MsgBox Err.Description
    Resume Exit_cmdOpenExcel_Click

End Sub
 
Code:
retVal = Shell("Excel " & Chr(34) & "\\bigguy\users\dom_f\Access\TestWebPAS2\TESTwebpas_download.xls" & Chr(34), vbMaximizedFocus)
 
ddiamond,
Thanks for the quick accurate reply. That did it.
Dom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top