Hi
I need a separate proceedure to close an already open workbook in excel 2010 from ms access 2010.
This is what I have but I cannot get it to work Thanks
Sub CloseExcel()
Dim wb As Excel.Workbook
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set wb = xlApp.Workbooks.Open("C:\Payroll_Summary.xls")
wb.Close True
xlApp.Quit
Set xlApp = Nothing
End Sub
I need a separate proceedure to close an already open workbook in excel 2010 from ms access 2010.
This is what I have but I cannot get it to work Thanks
Sub CloseExcel()
Dim wb As Excel.Workbook
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set wb = xlApp.Workbooks.Open("C:\Payroll_Summary.xls")
wb.Close True
xlApp.Quit
Set xlApp = Nothing
End Sub