Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default File renaming doesn't work

Thankx guys. It's working

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with renaming work sheet name D Moonn Excel Discussion (Misc queries) 2 April 19th 09 12:21 PM
renaming all work-sheets at once Narendra Boga[_2_] Excel Discussion (Misc queries) 4 June 6th 07 03:24 AM
vb code for renaming a work sheet with a cell reference John Britto Excel Discussion (Misc queries) 3 September 17th 06 07:12 PM
Renaming File Statement -How does it work?? KAHAUS Excel Programming 6 June 8th 05 02:58 PM
Renaming a file Paul C[_2_] Excel Programming 1 January 23rd 04 04:13 PM


All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"