Access VBA Not Saving Excel

T

Terry

Hello

I have a Access DB with VBA code that processes data in excel files. This
code has been working correctly but we just upgraded to Office 2007 and the
code still processes correctly except for saving and closing the excel file
when I am done.

Here is some code snippets:
---------------------------------------------
‘Public Declarations for Excel
Public xlApp As Object ' Declare object variables to hold the reference.
Public xlBook As Object
Public xlSheet As Object

‘ Call routine to open Excel
Call OpenExcel("AT&T - Video Volumes Summary")

‘Routine to open Excel and sheet
..
Set xlApp = CreateObject("excel.application")
Set xlBook = xlApp.Workbooks.Open(ChurnPath & "Video Churn Report", 0, False)
Set xlSheet = xlBook.Worksheets(TabName)

..
..
‘Process info on sheet
..
..

‘Save and Close Excel
xlBook.Close savechanges:=True
Set xlBook = Nothing
xlApp.Quit ' When you finish, use the Quit method to close
Set xlApp = Nothing ' the application, then release the reference.
-----------------------------------
Everything still works except for the "xlBook.Close savechanges:=True", when
it executes this statement the program stops responding and does not continue.

I appreciate any help that can be provided with this.

thanks

Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top