[AccessD] Access Function To Create Spreadsheet Fails On 2nd Run

Paul Hartland (ISHARP) paul.hartland at isharp.co.uk
Thu Dec 8 04:35:39 CST 2005


That's exactly the old code I had in place still getting the same
error....but I will try changing it back and running it again with Jim Hales
code in between and see what I get.... 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: 08 December 2005 10:19
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Access Function To Create Spreadsheet Fails On 2nd
Run

Hi Paul

No, you may not be closing the workbook properly. Try this:

objWB.Close
Set objWB = Nothing

/gustav

>>> paul.hartland at isharp.co.uk 08-12-2005 09:57:32 >>>
I used the code and I get the Excel Running message, the basis of my code is

Dim objExcel As Excel.Application
Dim objWB As Excel.Workbook 

Set objExcel = New Excel.Application
Set objWB = objExcel.Workbooks.Open(strProd) ' strProd is a string
containing the path to the workbook template.

objExcel.Workbooks.Close
Set objWB = Nothing
        
objExcel.Application.Quit
Set objExcel = Nothing

And I have really tried every way I could think of of closing the workbook
and the application.  Anyone know if I am closing the workbook and the
application incorrectly..

Paul Hartland


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list