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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,610
Messages
6,173,339
Members
452,510
Latest member
RCan29

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