ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close specific workbook (https://www.excelbanter.com/excel-programming/423353-close-specific-workbook.html)

Robert_L_Ross

Close specific workbook
 
I have one workbook that has a macro that imports a .txt or .dat file,
processes it then saves it to a specified location.

At the end of the macro, I tried closing the ActiveWorkbook but that ended
up being the 'new' file I created.

How do I close the 'source' file (the filet that is running the macro)?

joel

Close specific workbook
 
try Thisworkbook.Close

"Robert_L_Ross" wrote:

I have one workbook that has a macro that imports a .txt or .dat file,
processes it then saves it to a specified location.

At the end of the macro, I tried closing the ActiveWorkbook but that ended
up being the 'new' file I created.

How do I close the 'source' file (the filet that is running the macro)?


Robert_L_Ross

Close specific workbook
 
DOH! Genius!!

Thanks!

"Joel" wrote:

try Thisworkbook.Close

"Robert_L_Ross" wrote:

I have one workbook that has a macro that imports a .txt or .dat file,
processes it then saves it to a specified location.

At the end of the macro, I tried closing the ActiveWorkbook but that ended
up being the 'new' file I created.

How do I close the 'source' file (the filet that is running the macro)?



All times are GMT +1. The time now is 04:24 PM.

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