megatronixs
Registered User.
- Local time
- Today, 06:55
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I wanted to re-use some code that I have from Excel to print out a website to .xps with vba.
the below part of the code will use the xps printer. it uses in excel the value of a cell to create the file name. in the access database i should use the field "LE_Name":
I made those changes, but it breaks on the
and again at the end
I know that there is no active printer in the access vba, but have now clue how to solve the above.
"PrintTo" is where it gets the path name from.
Greetings.
I wanted to re-use some code that I have from Excel to print out a website to .xps with vba.
the below part of the code will use the xps printer. it uses in excel the value of a cell to create the file name. in the access database i should use the field "LE_Name":
Code:
Application.ActivePrinter = "Microsoft XPS Document Writer on ne01:"
'// Do you really want preview? Changed to False here to test actual file creation
Sheets("Results").Range("A1:R" & LastRow).PrintOut _
copies:=1, _
Collate:=True, _
PrintToFile:=True, _
PrToFileName:=PrintTo & (Sheets("Results").Range("B2").Value & ".xps"), _
Preview:=False, _
ActivePrinter:="Microsoft XPS Document Writer on ne01:"
I made those changes, but it breaks on the
Code:
Application.ActivePrinter = "Microsoft XPS Document Writer on
Code:
ActivePrinter:="Microsoft XPS Document Writer on ne01:"
I know that there is no active printer in the access vba, but have now clue how to solve the above.
"PrintTo" is where it gets the path name from.
Greetings.