LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default All Workbook Saved except This Workbook

Hi,

After several attempts, it fails to work correctly to save all opened
workbooks in a specific directory folder
It works fine when there are more than one excel files opened
However, in the event if there is no excel file being opened except
this workbook and prompt the message " All workbooks saved " based on
the following codes

Dim WB As Workbook
For Each WB In Workbooks
If Not WB Is Nothing Then
If WB.Name < ThisWorkbook.Name Then
With WB
.Sheets(1).Activate
SheetName = .ActiveSheet.Name
FileExtStr = ".xls": FileFormatNum = 56
.SaveAs Filename:=SheetName & FileExtStr, _
FileFormat:=FileFormatNum
.Close SaveChanges:=True
End With
End If
Else
MsgBox "No Excel File is found"
Exit Sub
End If
Next

MsgBox "All Workbooks Saved under this Directory Folder "

Any helps will be much appreciated and thanks in advance

Regards
Len

 
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
Why is Referenced Workbook Saved When ActiveWorkbook is Saved? RyanH Excel Programming 1 October 29th 08 08:20 PM
Worksheet saved out as new workbook TOMB Excel Programming 2 November 14th 07 07:53 PM
Changes to workbook not saved Jill Valentine Excel Discussion (Misc queries) 1 August 31st 07 02:56 PM
Save column J of WorkBook when WorkBook is not saved. mikeburg[_84_] Excel Programming 2 June 14th 06 09:57 PM
How can I see a copy of a saved workbook before I saved it again? Norma Excel Worksheet Functions 2 May 11th 05 10:31 AM


All times are GMT +1. The time now is 10:31 AM.

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

About Us

"It's about Microsoft Excel"