XPS Default File Name

G

Guest

Hi there:

I am printing to a .xps file. However, each file I save from .xls, prompts
for a file name with the .xps set as the default.
Does anyone know how to set the current workbook name of a .xls file as the
default name for the .xps file?

Much Appreciated,
David
 
J

Jim Rech

I guess you should save via a macro:

Sub SaveActiveWBookAsXPS()
Dim WBName As String
Dim DotPos As Integer
WBName = ActiveWorkbook.Name
DotPos = InStrRev(WBName, ".")
If DotPos > 0 Then WBName = Left(WBName, DotPos - 1)
ActiveSheet.ExportAsFixedFormat Type:=xlTypeXPS, Filename:="C:\" &
WBName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub


--
Jim
| Hi there:
|
| I am printing to a .xps file. However, each file I save from .xls, prompts
| for a file name with the .xps set as the default.
| Does anyone know how to set the current workbook name of a .xls file as
the
| default name for the .xps file?
|
| Much Appreciated,
| David
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top