Macro to save workbook with cell adress as file name to othe

G

Guest

Guest
I have a workbook that I want to save using information in a cell as the file name. I want this workbook to be saved to a location on our server rather than the default location in my hard drive. I've written some code as shown below. I've got the first part of the code worked out but I'm still having a problem with it saving to the server instead of my hard drive.


Private Sub CommandButton3_Click()
ThisFile = Range("G3") & Range("I3").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs Filename:= _ (maybe here to)
"\Pchq7ntoffshoreMaintenanceSouth Tim FormsWork OrdersUncompleted Work Orders????????????????????? _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
On 2002-02-19 06:07, Anonymous wrote:
I have a workbook that I want to save using information in a cell as the file name. I want this workbook to be saved to a location on our server rather than the default location in my hard drive. I've written some code as shown below. I've got the first part of the code worked out but I'm still having a problem with it saving to the server instead of my hard drive.


Private Sub CommandButton3_Click()
ThisFile = Range("G3") & Range("I3").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs Filename:= _ (maybe here to)
"Pchq7ntoffshoreMaintenanceSouth Tim FormsWork OrdersUncompleted Work Orders????????????????????? _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub

Try with

ActiveWorkbook.SaveAs Filename:= _ (maybe here to)
"Pchq7ntoffshoreMaintenanceSouth Tim FormsWork OrdersUncompleted Work Orders" & ThisFile _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,429
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top