Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File renaming doesn't work
Hello,
I made the following code, which opens the Save As box. I then change the dir, and want it to save it under the name given in cell AE2. But it doesn't work. I am working with excel2000. Any idea's why??????? Sub filerenaming() fileSaveName = Application.GetSaveAsFilename( _ InitialFilename:=Range("AE2").Value, _ fileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If fileSaveName < False Then MsgBox "Save as " & fileSaveName End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File renaming doesn't work
Hi A,
The GetSaveAsFiolename method only provides the user's name choice; it does not save the file. Try something like: '============= Public Sub filerenaming() Dim fileSaveName As Variant fileSaveName = Application.GetSaveAsFilename( _ InitialFilename:=Range("AE2").Value, _ FileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If fileSaveName < False Then ActiveWorkbook.SaveAs Filename:=fileSaveName, _ FileFormat:=xlWorkbookNormal End If End Sub '<<============= --- Regards, Norman "A. Karatas" wrote in message ups.com... Hello, I made the following code, which opens the Save As box. I then change the dir, and want it to save it under the name given in cell AE2. But it doesn't work. I am working with excel2000. Any idea's why??????? Sub filerenaming() fileSaveName = Application.GetSaveAsFilename( _ InitialFilename:=Range("AE2").Value, _ fileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If fileSaveName < False Then MsgBox "Save as " & fileSaveName End If End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
File renaming doesn't work
You are almost there. Missing only a single line:
Sub filerenaming() fileSaveName = Application.GetSaveAsFilename( _ InitialFileName:=Range("AE2").Value, _ fileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If fileSaveName < False Then ActiveWorkbook.SaveAs Filename:=fileSaveName MsgBox "Save as " & fileSaveName End If End Sub The Msgbox was there but not the actual Save. -- Gary''s Student - gsnu200720 "A. Karatas" wrote: Hello, I made the following code, which opens the Save As box. I then change the dir, and want it to save it under the name given in cell AE2. But it doesn't work. I am working with excel2000. Any idea's why??????? Sub filerenaming() fileSaveName = Application.GetSaveAsFilename( _ InitialFilename:=Range("AE2").Value, _ fileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If fileSaveName < False Then MsgBox "Save as " & fileSaveName End If End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
File renaming doesn't work
Thankx guys. It's working
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with renaming work sheet name | Excel Discussion (Misc queries) | |||
renaming all work-sheets at once | Excel Discussion (Misc queries) | |||
vb code for renaming a work sheet with a cell reference | Excel Discussion (Misc queries) | |||
Renaming File Statement -How does it work?? | Excel Programming | |||
Renaming a file | Excel Programming |