Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Macro to Publish as PDF

16 views
Skip to first unread message

lfullam1

unread,
May 14, 2013, 11:30:09 AM5/14/13
to

Hello all,

So I have a sheet within a workbook that I am wanting to save/publish as
a PDF file. the code i have thus far is :

Sub Publish2()
'
' Publish2 Macro
'

'
Sheets("bat").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Liam\Desktop\BAT review.pdf",
Quality:=xlQualityStandard _
, IncludeDocProperties:=True, IgnorePrintAreas:=False,
OpenAfterPublish:= _
True
End Sub

Nice and simple and does the trick. The question I have is how can I
make define the directory string such that a multitude of users on
different computers can all run this macro?

Thanks in advance!




--
lfullam1

Claus Busch

unread,
May 14, 2013, 11:55:24 AM5/14/13
to
Hi Liam,

Am Tue, 14 May 2013 16:30:09 +0100 schrieb lfullam1:

> Nice and simple and does the trick. The question I have is how can I
> make define the directory string such that a multitude of users on
> different computers can all run this macro?

try:
Filename:="C:\Users\" & Application.UserName & _
"\Desktop\BAT review.pdf"


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
0 new messages