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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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