Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try,
Sub SaveASCellValue() ActiveWorkbook.SaveAs Filename:=Range("A1").Value ActiveWorkbook.SaveAs Filename:=Range("A1").Value End Sub -- Regards Corey |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
Disable save, save as, but allow save via command button | Excel Programming | |||
How to diasble save and save as menu but allow a save button | Excel Programming | |||
how to get disk icon on save button of save as dialog like 2000 | Excel Discussion (Misc queries) | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming |