S
simon.frangenberg
I am Working on the following code:
Dim resp As Long
Dim sFilename As Variant
Dim newName As String
newName = "I:\Klant Directory\book1.xls"
sFilename = Application.GetSaveAsFilename( _
InitialFileName:=newName)
If sFilename = False Then Exit Sub
If Dir(sFilename) <> "" Then
resp = MsgBox(prompt:="File already exists. Do you want to
overwrite?", Buttons:=vbYesNo)
If resp = vbNo Then
Exit Sub
End If
End If
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs sFilename
Application.DisplayAlerts = True
Instead of book1; I want to save excel files in the following format:
subject-client-date-author (e.g. Report-Vbacorp-20080818-MF).
Furthermore, if I run the macro, I want to have a dialogbox that pups
up with date and author already filled out as in the above mentioned
example (thus: now() and MF). Moreover, I want to be able to fill out
in the dialog box the subject and client. Dialog box example:
Subject:
Client:
Date: default format(now(),”yyyymmdd”)
Author: default MF
Save Cancel
I do not know how to fix the code above in order to achieve this, doe
anyone have a clue?
Dim resp As Long
Dim sFilename As Variant
Dim newName As String
newName = "I:\Klant Directory\book1.xls"
sFilename = Application.GetSaveAsFilename( _
InitialFileName:=newName)
If sFilename = False Then Exit Sub
If Dir(sFilename) <> "" Then
resp = MsgBox(prompt:="File already exists. Do you want to
overwrite?", Buttons:=vbYesNo)
If resp = vbNo Then
Exit Sub
End If
End If
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs sFilename
Application.DisplayAlerts = True
Instead of book1; I want to save excel files in the following format:
subject-client-date-author (e.g. Report-Vbacorp-20080818-MF).
Furthermore, if I run the macro, I want to have a dialogbox that pups
up with date and author already filled out as in the above mentioned
example (thus: now() and MF). Moreover, I want to be able to fill out
in the dialog box the subject and client. Dialog box example:
Subject:
Client:
Date: default format(now(),”yyyymmdd”)
Author: default MF
Save Cancel
I do not know how to fix the code above in order to achieve this, doe
anyone have a clue?