View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
annep[_10_] annep[_10_] is offline
external usenet poster
 
Posts: 1
Default Macro file save as, saving sheet not workbook


I am using the below routine, which I found in this newsgroup, but
instead of saving the file as Postingsum011706.iif, it renames the
current sheet, I don't want to change the worksheet name, I want to
change the file name for Postingsum plus date, which is located in
field C4.

Public Sub PostingSumSave()

Dim sStr As String
Const sDateCell As String = "c4"
Const SPath As String = "C:\access\"
sStr = Format(Range(sDateCell), "mmddyy")
ThisWorkbook.SaveAs Filename:=SPath & "PostingSum" & sStr & ".iif", _
FileFormat:=xlText, CreateBackup:=False
If ThisWorkbook.Saved = False Then
ThisWorkbook.Save
Application.DisplayAlerts = True
MsgBox "The Posting Summary for this week has been created, Saving
and closing Workbook"
ActiveWorkbook.Close

End Sub

I am also having problems suppressing the save messages, but I think
that is related to it renaming the sheet, then of course it is asking
to save the workbook.


--
annep
------------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=503559