michele227
New Member
- Joined
- Feb 15, 2023
- Messages
- 15
- Office Version
- 2019
- Platform
- Windows
Hi everyone!
I am currently trying to put together a VBA to open a file dialogue, select PNG files, have a window come up to select the printer, and then print them out with the selected printer.
Everything works, except the printing out part!
I would really appreciate any guidance!
This is what I have so far:
Thank you in advance!
I am currently trying to put together a VBA to open a file dialogue, select PNG files, have a window come up to select the printer, and then print them out with the selected printer.
Everything works, except the printing out part!
I would really appreciate any guidance!
This is what I have so far:
Sub PrintOutSketches2()
Dim selectedfiles As String
Dim xApp As Object
Dim xFileDlg As FileDialog
Dim xSelItem As Variant
On Error Resume Next
Set xApp = CreateObject("Excel.Application")
xApp.Visible = False
Set xFileDlg = Application.FileDialog(msoFileDialogFilePicker)
xFileDlg.InitialFileName = Sheets("Payment Schedule").Range("O17").Value
xFileDlg.AllowMultiSelect = True
xFileDlg.Filters.Add "PNG", "*.png"
xFileDlg.Title = "Select Drawings"
If xFileDlg.Show <> 0 Then
selectedfiles = xFileDlg.SelectedItems(1)
x = Application.Dialogs(xlDialogPrinterSetup).Show
Debug.Print
End If
Sheets("Payment Schedule").Select
End Sub
Thank you in advance!