Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
wal wal is offline
external usenet poster
 
Posts: 19
Default Test if workbook is not yet named

Excel 2003

I have a simple SaveAll macro using For Each...Next. It loops through
open workbooks and saves them.

If a new, as-yet-unnamed workbook is open, the macro will save that as
Book1.xls in My Documents, without a prompt. (Of course, if you hit
Ctrl-S when that workbook is active, you get the Save dialog.)

How can you test whether a workbook has been unnamed or never-been-
saved? I would include that code to skip that workbook in the For
Each loop.

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Test if workbook is not yet named

Check the length of the workbook path.
--
Jim Cone
Portland, Oregon USA


"wal"
wrote in message
Excel 2003
I have a simple SaveAll macro using For Each...Next. It loops through
open workbooks and saves them.
If a new, as-yet-unnamed workbook is open, the macro will save that as
Book1.xls in My Documents, without a prompt. (Of course, if you hit
Ctrl-S when that workbook is active, you get the Save dialog.)
How can you test whether a workbook has been unnamed or never-been-
saved? I would include that code to skip that workbook in the For
Each loop.
Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Test if workbook is not yet named

You could also check if Dir(workbook.fullname) < "", meaning this is a
file?

HTH. Best wishes Harald

"wal" wrote in message
...
Excel 2003

I have a simple SaveAll macro using For Each...Next. It loops through
open workbooks and saves them.

If a new, as-yet-unnamed workbook is open, the macro will save that as
Book1.xls in My Documents, without a prompt. (Of course, if you hit
Ctrl-S when that workbook is active, you get the Save dialog.)

How can you test whether a workbook has been unnamed or never-been-
saved? I would include that code to skip that workbook in the For
Each loop.

Thanks.


Reply
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
Logical Test for a value in a named list? mooresk257 Excel Discussion (Misc queries) 10 October 15th 09 10:52 PM
Test a named cell in a macro [email protected] Excel Programming 1 July 24th 07 04:38 PM
Named Cell test Brettjg Excel Discussion (Misc queries) 4 June 11th 07 03:30 AM
Test if ActiveCell is within a certain named range Steven Excel Programming 2 March 8th 06 05:18 PM
easy way to test if a Named Range exists Andrew Bauer Excel Programming 4 July 10th 03 07:32 PM


All times are GMT +1. The time now is 02:58 AM.

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"