new name

deanl33069

Board Regular
Joined
May 2, 2019
Messages
120
I have this code to save a file as pdf.
Private Sub CommandButton1_Click()


ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
filename:="C:\release\testpage2.pdf", _
OpenAfterPublish:=False, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
Quality:=xlQualityStandard, _
From:=1, To:=2
End Sub
how can i save as cell "c2"
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Is C2 on that sheet?

Code:
[LEFT][COLOR=#333333][FONT=Verdana]ActiveSheet.ExportAsFixedFormat _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    Type:=xlTypePDF, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    filename:=Activesheet.Range("C2").Value, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    OpenAfterPublish:=False, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    IncludeDocProperties:=True, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    IgnorePrintAreas:=False, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    Quality:=xlQualityStandard, _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]    From:=1, To:=2[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]End Sub[/FONT][/COLOR][/LEFT]
 
Upvote 0
Code:
[FONT=Verdana][COLOR=#333333]ActiveSheet.ExportAsFixedFormat _[/COLOR][/FONT][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    Type:=xlTypePDF, _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    filename:=Activesheet.Range("C2").Value, & ".pdf" _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    OpenAfterPublish:=False, _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    IncludeDocProperties:=True, _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    IgnorePrintAreas:=False, _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    Quality:=xlQualityStandard, _[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]    From:=1, To:=2[/FONT][/FONT][/COLOR][/LEFT][/COLOR][LEFT][COLOR=#333333][FONT=monospace]
[/FONT][/COLOR][/LEFT][COLOR=#333333][LEFT][COLOR=#333333][FONT=monospace][FONT=Verdana]End Sub[/FONT][/FONT][/COLOR][/LEFT][/COLOR]
 
Upvote 0
Ty But i get
s!AqrVlEBa2rE1iVa2DRBEHzZn0zRy

s!AqrVlEBa2rE1iVa2DRBEHzZn0zRy
https://1drv.ms/u/s!AqrVlEBa2rE1iVa2DRBEHzZn0zRy
s!AqrVlEBa2rE1iVa2DRBEHzZn0zRy
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top