ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save or SaveAs Macro (https://www.excelbanter.com/excel-programming/355258-save-saveas-macro.html)

knosalaa

Save or SaveAs Macro
 

I have several files on Co Network and would like to build a Macro
(behind a button) that would auto assign file name (using workbook cell
reference - one identify name and second cell date) and when button is
pressed it would perform save or saveas function re-directing that file
to a specific network directory. I have tried several combinations with
both save and saveas but in save it will not allow me to reference
cell's from which i woulod like to enter name and with saveas function
it allows me to assign name but it will not recognize network address
where i would like to save the file. Also, with saveas function it
closes original file and opens saved as file and I'm trying to have
user stay in original file that was open. Any help will be greatly
appreciated

Thanks
Arthur


--
knosalaa
------------------------------------------------------------------------
knosalaa's Profile: http://www.excelforum.com/member.php...o&userid=32204
View this thread: http://www.excelforum.com/showthread...hreadid=519534


Dick Kusleika[_4_]

Save or SaveAs Macro
 
Arthur

You can use the SaveCopyAs method if you want to save a copy of the file and
leave the original open and in its same location. If you can't get SaveAs
to recognize the network address, you won't have better luck with
SaveCopyAs. Likely, you have a typo in your path and it points to a
directory that doesn't exist. You may also be missing a backslash somewhere
in there. If you can't figure it out, post the code and the error message
you're getting.

--
Dick Kusleika
MVP-Excel
www.dailydoseofexcel.com

knosalaa wrote:
I have several files on Co Network and would like to build a Macro
(behind a button) that would auto assign file name (using workbook
cell reference - one identify name and second cell date) and when
button is pressed it would perform save or saveas function
re-directing that file to a specific network directory. I have tried
several combinations with both save and saveas but in save it will
not allow me to reference cell's from which i woulod like to enter
name and with saveas function it allows me to assign name but it will
not recognize network address where i would like to save the file.
Also, with saveas function it closes original file and opens saved as
file and I'm trying to have user stay in original file that was open.
Any help will be greatly appreciated

Thanks
Arthur




knosalaa[_2_]

Save or SaveAs Macro
 

I don't have working code as i have tried many options. If my memory
serves me right

sub filesave ()

filename=range("8-dir'!d4")

Workbook.SaveAs filename="W:\Corp...\subdir\filename & format(Now)
mmmyyyy) & "(.xls)"

end sub


as you can see filename only have one cell reference and i need two
where second has date format in different worksheet.

thanks for your quick responce
Arthur


--
knosalaa
------------------------------------------------------------------------
knosalaa's Profile: http://www.excelforum.com/member.php...o&userid=32204
View this thread: http://www.excelforum.com/showthread...hreadid=519534



All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com