I would like to create a macro to produce an XPS document from an excel worksheet that can then be saved with the anme of a value in a cell in another worksheet.
I need to use the print to microsoft office XPS document writer to create the XPS file as the document loses format when using the Save as or export as file type function.
The macro below enables me to publish as xps and open the save as dialogue box but as I intend to do this for many worksheets I would like to be able to automate the saving of each worksheet with a specific file name.
If anyone could advise how to modify the macro below to automate the saving process it would be much appreciated.
Dim i As Integer
For i = 1 To 3
Sheets("Search").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = i
Sheets("Output Page").Select
Application.ActivePrinter = "Microsoft XPS Document Writer on Ne00:"
ExecuteExcel4Macro _
"PRINT(2,1,2,1,,,,,,,,2,""Microsoft XPS Document Writer on Ne00:"",,TRUE,,FALSE)"
Next i
I need to use the print to microsoft office XPS document writer to create the XPS file as the document loses format when using the Save as or export as file type function.
The macro below enables me to publish as xps and open the save as dialogue box but as I intend to do this for many worksheets I would like to be able to automate the saving of each worksheet with a specific file name.
If anyone could advise how to modify the macro below to automate the saving process it would be much appreciated.
Dim i As Integer
For i = 1 To 3
Sheets("Search").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = i
Sheets("Output Page").Select
Application.ActivePrinter = "Microsoft XPS Document Writer on Ne00:"
ExecuteExcel4Macro _
"PRINT(2,1,2,1,,,,,,,,2,""Microsoft XPS Document Writer on Ne00:"",,TRUE,,FALSE)"
Next i