#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Save as !

I have made a control button on my worksheet, to "save as"
Is there a way I can program this button to recognise a name in a cell and
use that name as the filename to save as. I realise there is a button for it
in the file menu, but I've been asked to put one on the Work sheet.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Save as !

try,




Sub SaveASCellValue()
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
End Sub





--
Regards

Corey


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Save as !

Thank you, works a treat.

"Corey" wrote:

try,




Sub SaveASCellValue()
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
End Sub





--
Regards

Corey



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Save as !

Corey wrote:
try,

Sub SaveASCellValue()
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
End Sub


I also would like to do this, but when I try, I get an error message :A file
named 'TRUE.xls' already exists in this location.

But the contents of A1 contain 'TEST' or NOW() or other text.

What am I doing wrong ?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Save as !

I adapted the advice given to read;

ActiveWorkbook.saveas Filename:=("C:\Documents and Settings\steve\Desktop\")
+ Range("E7").Value

the code line is only written once. And it saves to my desktop, and from
there I can move it to the required storage place.
I only get an error messageit I try to resave using my button and I havent
changed the file name.Thats when you get the File already exists line and
asks if you wish to overwrite it.

Hope this helps.

Steve

"Francois via OfficeKB.com" wrote:

Corey wrote:
try,

Sub SaveASCellValue()
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
End Sub


I also would like to do this, but when I try, I get an error message :A file
named 'TRUE.xls' already exists in this location.

But the contents of A1 contain 'TEST' or NOW() or other text.

What am I doing wrong ?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Save as !

I suspect you've written
.... Filename=Range("A1").Value
instead of
.... Filename:=Range("A1").Value

Note the colon after "Filename"

I can't see the beginning of this thread so I don't
know why Corey suggests doing the SaveAs
twice..




Francois via OfficeKB.com wrote:
Corey wrote:
try,

Sub SaveASCellValue()
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
ActiveWorkbook.SaveAs Filename:=Range("A1").Value
End Sub


I also would like to do this, but when I try, I get an error message :A file
named 'TRUE.xls' already exists in this location.

But the contents of A1 contain 'TEST' or NOW() or other text.

What am I doing wrong ?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Save as !

Andrew Taylor wrote:
I suspect you've written
... Filename=Range("A1").Value
instead of
... Filename:=Range("A1").Value

Note the colon after "Filename"

I can't see the beginning of this thread so I don't
know why Corey suggests doing the SaveAs
twice..

try,

[quoted text clipped - 13 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1





Thanks folks All is OK now

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Save as !

Andrew Taylor wrote:
I suspect you've written
... Filename=Range("A1").Value
instead of
... Filename:=Range("A1").Value

Note the colon after "Filename"

I can't see the beginning of this thread so I don't
know why Corey suggests doing the SaveAs
twice..

try,

[quoted text clipped - 13 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1





Thanks folks All is OK now

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

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
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM


All times are GMT +1. The time now is 07:16 PM.

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

About Us

"It's about Microsoft Excel"