[AccessD] Excel Automation Question

Paul Hartland paul.hartland at googlemail.com
Thu Aug 25 15:45:05 CDT 2016


Rocky

Just off hand there is some code that checks if an application is open, I
haven't got this to hand but sure a google search will find some, when the
user returns to the access app could you not run the function to check if
an instance of Excel is open and if so then close it from Access, obviously
a problem with this is if the user returns to the Access app and still
wants the Excel sheet open, but just a thought.

Paul

On 25 August 2016 at 20:55, Rocky Smolin <rockysmolin at bchacc.com> wrote:

> Dear List:
>
>
>
> I want to open a spreadsheet from Access and am using:
>
>
>
>     Set objXLApp = New Excel.Application
>
>     objXLApp.Workbooks.Open gstrBackEndPath & "\PO_" &
> Me.cboPOList.Column(1) & ".xlsx"
>
>     objXLApp.Visible = True
>
>
>
> which works just fine.  However, when the spreadsheet is closed by the user
> the instance of Excel remains - I can see it in the Task Manager.
>
>
>
> If I close the spreadsheet from Access:
>
>
>
>     objXLApp.ActiveWorkbook.Save
>
>     objXLApp.ActiveWorkbook.Close True
>
>     objXLApp.Quit
>
>     Set objXLApp = Nothing
>
>
>
> Of course, Excel goes away.
>
>
>
> Is there a technique for closing that instance of access when the user
> closes a spreadsheet opened by an access program?
>
>
>
> MTIA
>
>
>
>
>
> Rocky Smolin
>
> Beach Access Software
>
> 760-683-5777
>
>  <http://www.bchacc.com> www.bchacc.com
>
>  <http://www.e-z-mrp.com> www.e-z-mrp.com
>
> Skype: rocky.smolin
>
>
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Paul Hartland
paul.hartland at googlemail.com


More information about the AccessD mailing list