View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Workbook naming

If the workbook is not saved you don't have to delete it.
You can simple close it and tell Excel not to save

ActiveWorkbook.Close False

I don't see your code but if your code add a new workbook to
merges all the open workbooks in like this

Dim DestSh As Worksheet
Set DestSh = Worksheets.Add

'.... code

DestSh.Close False


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jenny" wrote in message ...
Here is what I need to do. I have any number or workbooks
open and the user can run a macro that merges all the open
workbooks into a single workbook (with a tab for each of
the open workbooks). I.e. if there were 3 open workbooks,
the merged workbook would have 3 tabs.

When I make a new workbook to hold the data from the other
open workbooks, a default name is set for the new workbook
(usually Book2.xls) I just want to change this name
without saving the workbook because the workbook needs to
be deleted shortly after it is created (and it can't be
deleted if the workbook is still open) Sadly, I could
work with this but I need to do some other tasks with the
workbook that require it to not be read only <sigh

I hope this makes sense...

~Jenny