Convert file to pdf regardless of user

KhallP

Board Regular
Joined
Mar 30, 2021
Messages
157
Office Version
  1. 2016
Platform
  1. Windows
I tried to create a procedure whose objective is to convert the excel spreadsheet to pdf and save it in the folder "D:\Users\(UserName)\Documents\Project\(MachineName)", this program will be used by several users on different computers , how can I make the PDF be saved in the documents regardless of the user who is accessing it?



Available folders to save the file depending on the MachineName variable:

print_1.JPG




My Sub for convert file to PDF:

print_2.JPG



The file format must remain the same (MachineName, "Date of Today")

print_3.JPG
 
That's actually your code as you posted it. I didn't notice that you broke it onto two lines but didn't put a line continuation character in. I've amended my version above.
and can you make me a code that if the file already exists the next file is called "file1 (2)" and onwards?
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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