ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CLosing Linked datatable (https://www.excelbanter.com/excel-programming/384078-closing-linked-datatable.html)

Candyman

CLosing Linked datatable
 
I have a report template that saves a report twice; a 'DatedReport 20070227'
and a 'LastReport'. I created a 'LastDate' table in the LastReport report
that is refered to in the template (it is in a small data query). So when
the template runs it updates the datatable linked to the LastReport.LastDate,
but now I want to save the report.

The file will save as DatedReport 20070227 just fine, but it will not allow
me to overwrite the LastReport saying #70: Access Denied.

I think the link from the tempolate to the LastReport is still open.
Q- How do I close the connection to the LastReport so I can overwrite the
file?

Thanks so much for you help.

Candyman

CLosing Linked datatable
 
I found the answer using :
Sheets("Corrective Action Record").QueryTables("Latest_Report").Delete

"Candyman" wrote:

I have a report template that saves a report twice; a 'DatedReport 20070227'
and a 'LastReport'. I created a 'LastDate' table in the LastReport report
that is refered to in the template (it is in a small data query). So when
the template runs it updates the datatable linked to the LastReport.LastDate,
but now I want to save the report.

The file will save as DatedReport 20070227 just fine, but it will not allow
me to overwrite the LastReport saying #70: Access Denied.

I think the link from the tempolate to the LastReport is still open.
Q- How do I close the connection to the LastReport so I can overwrite the
file?

Thanks so much for you help.



All times are GMT +1. The time now is 05:53 PM.

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