Is there a way to print a file from default printer using Apple script

We have a file path , how can we print it from a printer

Using lp file_path, I was able to print only PDF’s. Unable to print docx,xlsx,ppt,.numbers,.pages,.key

And I tried individual scripts as below

set filePath to “/Users/syamala/Desktop/Print/Book1.xlsx”
tell application “Microsoft Excel”
activate
open filePath
print out active sheet
close active workbook saving no
end tell

it is not working

I am using virtual printer : PDF Writer and PDF Printer.

Any help is much appreciated

A virtual printer is an application that replicates the software interface for a physical printer and allows the user to carry out various tasks without actually printing anything. It is like printing some text on your screen (into the some window. For example, the text you see as output in the Terminal window)… and not on the paper.

How want you print using something that doesn’t print?..

If you want print on your default printer, which is physical device, then try something like this:

set defaultPrinterName to "HP_LaserJet_52001"
set aFile to POSIX file "/Users/syamala/Desktop/Print/Book1.xlsx"

tell application "System Preferences" to print aFile with properties {target printer:defaultPrinterName} without print dialog

NOTE: I don’t have currently any printer to test this my propose.