View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Recording a 'Save As...'

Dim myFilePath as string
myFilePath = "C:\Documents and Settings\"
myFilePath = myfilepath & Environ("USERNAME")
myFilePath = myfilepath & "\Desktop\"

If you want to save it as a template without macros, I'd save it as a .xltx
file and the fileformat for that is 54. If you want to save as a
template with macros, save as a .xltm file, fileformat 53

HTH,
Barb Reinhardt

"camlad" wrote:

Recording a 'Save As...' I get this:



ActiveWorkbook.SaveAs Filename:= _

"C:\Documents and Settings\FH\Desktop\ Diary.xls", FileFormat:= _

xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _

, CreateBackup:=False



Two questions:



1

The file will be saved as a Template and used on other computers. How can
the code be changed so the file will be saved to the desktop of any
computer.



2

Can the macros be omitted in the saved file? If so what is the code?



Thanks



Camlad