Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Logical Test for a value in a named list? | Excel Discussion (Misc queries) | |||
Test a named cell in a macro | Excel Programming | |||
Named Cell test | Excel Discussion (Misc queries) | |||
Test if ActiveCell is within a certain named range | Excel Programming | |||
easy way to test if a Named Range exists | Excel Programming |