VBA Help - Save as PDF, Save to Desktop (Any User), File Name

Zef05

New Member
Joined
Oct 21, 2016
Messages
10
Hi!

I am trying to create a sales form for my four-man team.
I have codes for saving the file as PDF, using a filename in a designated cell, but it only works on my computer.
I was wondering if there is a way to use the same file and just save it to their desktops.

Thank you!
 
You need to put the sheetname and cell reference in, what's the sheet name and address of the cell?

I change it to the correct sheet name, and the filename I want used is in cell A1.
This time it gave me an error 400.

This is what I have in the VBA


Sub Button1_Click()
ThisWorkbook.SaveAs CreateObject("WScript.Shell").specialfolders("Desktop") & "" & Sheets("V3").Range("A1").Value
End Sub
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
It should be:
Rich (BB code):
ThisWorkbook.SaveAs CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & Sheets("V3").Range("A1").Value
 
Upvote 0
it needs to go in a sub:
Rich (BB code):
Sub Button1_Click()
    ThisWorkbook.SaveAs CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & Sheets("V3").Range("A1").Value
End Sub
 
Upvote 0
it needs to go in a sub:
Rich (BB code):
Sub Button1_Click()
    ThisWorkbook.SaveAs CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & Sheets("V3").Range("A1").Value
End Sub


I'm giving up on this one. It gave me an error 400.


How about choosing where it will be saved instead of automating it to the desktop?
That will work for all users since they will assign the location, right?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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