Open Workbook from Access Problem

Carly

Registered User.
Local time
Today, 17:07
Joined
Apr 16, 2003
Messages
86
I have got an access database which opens an Excel workbook using the following code:
Code:
With CreateObject("Excel.Application")
   .Workbooks.Open "\\stoke\analytic$\Price Increase\MarginRecoveryPlan " & vMonth & "\zPricingExtractManipulation\PricingExtractManipulation-MACRO.xlsm", True
   .Visible = True
End With
DoCmd.Close acForm, "FrontPage", acSaveNo
DoCmd.Quit

The Excel workbook as a form which loads when the workbook is opened as follows:
Code:
Private Sub Workbook_Open()
   frmStages.Show
End Sub

The problem I have got is the Access database just hangs instead of closing until something is done with the form on the excel workbook, which is not what I want to happen...& if I change the form on the Excel spreadsheet to be ShowModal = False, then the excel workbook doesnt seem to open properly.

Is there anything I can do so that it works like, Access Database closes, Excel workbook open as if I was manually doing so?
 
This has been completely answered on the other forum:

Code:
Call Shell("Excel.EXE ""\\stoke\analytic$\Price Increase\MarginRecoveryPlan " & vMonth & "\zPricingExtractManipulation\PricingExtractManipulation-MACRO.xlsm""", vbNormalFocus)
 

Users who are viewing this thread

Back
Top Bottom