LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 204
Default Error Handling - Check a file isn't already open before overwritin

I have some code that exports data from my workbook to a new workbook. The
file name is the strFile variable and the file folder path is the strFolder
variable.

wbNew.SaveAs strFolder & strFile & ".xls"
wbNew.Close

I get an error if you are exporting data for a second time and have
forgotten to close down the exported file after viewing it.

Can I put in some sort of check that will show a message saying the file is
open, please close it and try again rather than it taking the user to the
debugger.

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check for Open File! Ayo Excel Discussion (Misc queries) 2 August 11th 08 06:55 PM
Error Handling Kevin Excel Discussion (Misc queries) 4 June 19th 08 12:31 AM
EXCEL:Can't open any file without error saying it's ALREADY open??? Crackles McFarly Excel Worksheet Functions 1 November 1st 07 02:22 AM
check if file is already open mohavv Excel Discussion (Misc queries) 1 October 15th 07 12:08 AM
Handling #NUM! error Michel Khennafi Excel Worksheet Functions 1 February 26th 07 08:49 PM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"