Print PDF files from folder.

Tofik

Board Regular
Joined
Feb 4, 2021
Messages
114
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi guys, I need a VBA formula which can help me with PDF files PRINTING.

How I thing it should be ? :
1) Excel with button ( Print ) Which print all cells with numbered files.
2) Folder include reports names : 12763-12764_AZF-CS-4004 and in excel I write only AZF-CS-4004. Is it possible to Print in this way or I should write all the file name like 12763-12764_AZF-CS-4004 ?
3) Print sequence to avoid manual sorting printed papers.

1666847603513.png

1666847495153.png
 
The error occurs because Set Sh = CreateObject("Shell.Application") failed and therefore the Sh object is undefined (Nothing), probably because your account doesn't have the required permissions to access the Windows shell.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The error occurs because Set Sh = CreateObject("Shell.Application") failed and therefore the Sh object is undefined (Nothing), probably because your account doesn't have the required permissions to access the Windows shell.
how can i fix that?
 
Upvote 0
First, step through the code with F8 to confirm my theory. If I'm correct, you would need to set the permissions. Also check that what I said in post #5 is true for you:

This macro should work, as long as Print is shown in the context menu when you right-click on a PDF file in File Explorer, because it uses the Shell32 object.
 
Upvote 0
First, step through the code with F8 to confirm my theory. If I'm correct, you would need to set the permissions. Also check that what I said in post #5 is true for you:
i tried with F8 too, so i found the blockage, i also can't try that third step you gave until i solve the error
 
Upvote 0
Checking the 'third step' is simply you manually interacting with the File Explorer UI and nothing to do with the VBA error or Excel.
 
Upvote 0
unfortunately i couldn't find anything about spooling on my printer's properties
 
Upvote 0

Forum statistics

Threads
1,221,624
Messages
6,160,904
Members
451,675
Latest member
Assy Bissy

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