Thread: SAVE AS MACRO
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default SAVE AS MACRO

My macro is as follows:-
'Sub SaveMe()
myFilename = InputBox("Enter filename") & ".xls"
myDir = "C:\documents and settings\mike\my documents"
ActiveWorkbook.SaveAs Filename:= _
myDir & "\" & myFilename, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

"Ninja Stevie" wrote:

There is a problem with your VBA code (the macro).

if you open up your visual basic editor, and look at the module
containing the code (or click debug when you get this message, you want
to insert the following code (but adapt it accordingly)

If(whatYouTyped="no") Then
MsgBox "File not overwritten."
Exit Sub
End If