Save Macro

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,540
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I hav ethe following macro that saves my workbook to my desktop, but is there a way to save it to anyones desktop

ie whoever open the workbook?

Code:
Option Explicit
Sub Save()

    Dim newFile As String, fName As String
    fName = Range("GL15").Value
    ChDir _
    "C:\Users\Bob Mahon\Desktop"
    ActiveWorkbook.SaveAs Filename:=fName

End Sub

Many thanks
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Yes you can do this changing the path,when you have access to his pc.
"\\192.168.0.1\Users\Bob Mahon\Desktop"
 
Upvote 0
Hi live_excel,

was hoping for a change in the code ?

Thanks
 
Upvote 0
Try this:
Code:
Option Explicit
Sub Save()
    Dim newFile As String, fName As String
    fName = CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & Range("GL15").Value
    ActiveWorkbook.SaveAs Filename:=fName
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,517
Messages
6,114,089
Members
448,548
Latest member
harryls

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