ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I cannot close a workbook in vba, I think because it odlinked to (https://www.excelbanter.com/excel-programming/334118-i-cannot-close-workbook-vba-i-think-because-odlinked.html)

supemsd

I cannot close a workbook in vba, I think because it odlinked to
 
I have tried almost everything to close a workbook in vba. This workbook has
content from a running module in Access, and is linked to a table in an
Access database. I set the object to nothing at the end, quit the workbook
even quit the Application with no effect. Error is observed when i attempt
to repopulate the same workbook and the global for the first variable is
exceeded. I also saveas before the closing. Nothing seems to work.

cmart02

I cannot close a workbook in vba, I think because it odlinked to
 
You have not said what methods you used, but for the workbook your should use:

Dim wb As Workbook

Set wb = Workbooks.Open("C:\WORKBOOKNAME.xls")
wb.Close

Set wb = Nothing

Then, the workbook you opened will be definetely closed.
--
Regards
Robert
Find me at www.msofficegurus.com - be part of it!


"supemsd" wrote:

I have tried almost everything to close a workbook in vba. This workbook has
content from a running module in Access, and is linked to a table in an
Access database. I set the object to nothing at the end, quit the workbook
even quit the Application with no effect. Error is observed when i attempt
to repopulate the same workbook and the global for the first variable is
exceeded. I also saveas before the closing. Nothing seems to work.



All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com