Thread: File save as
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default File save as

Just to add, filter became a reserved word when it was added as a function
in VBA6 (xl2000, xl2002) that would be why it wasn't a problem in xl97.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Ian,

Filter is a built-in function in VBA, and therefore a reserved word.

Change
your variable name to something else.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Ian Mangelsdorf" wrote in message
om...
I have a section of code that worked OK with Excel 97, however when I
run it with 2000 or XP I get errors along the lines of "Compiler error
Augument not optional. Is there an easy way of updating this code so
that the code will save the file in a given (by the user) location
with a given (by the user) name

Cheers

Ian

'save new job


'set up filters
filter = "Excel Files (*.xls), *.xls,"

' Display *.sub by default
filterindex = 1

' Set dialog caption
Title = "Save File As"
savefileas = Application.GetSaveAsFilename(Well.Text, filter, _
filterindex, Title)
If savefileas = False Then
Exit Sub
End If
ThisWorkbook.SaveAs Filename:=savefileas