Hi
in macro under I have fixed path+Name.
My issue is that i dont know how to get macro to pick up path+name of open woorkbook
I need to save pdf in same folder as excel is saved, and Name (not .xlsm but .pdf extension)
So i need macro to read path and filename then save pdf with same name and path but with PDF extension
Here is my fixed path+name
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\Google Drive\Price enquiry\2020.10.28. House1\2020.10.28. House1.pdf"
===========================================================================
Sub LagrePDF()
'
' LagrePDF Macro
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\Google Drive\Price enquiry\2020.10.28. House1\2020.10.28. House1.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 595.7142519685, _
320.3571653543, 366.4285826772, 98.5714173228).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
"HUSK Å GI NYTT NAVN PÅ PDF"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).ParagraphFormat. _
FirstLineIndent = 0
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).Font
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorDark1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
.Size = 18
.Name = "+mn-lt"
End With
Application.Wait (Now + TimeValue("0:00:10"))
Selection.Delete
End Sub
in macro under I have fixed path+Name.
My issue is that i dont know how to get macro to pick up path+name of open woorkbook
I need to save pdf in same folder as excel is saved, and Name (not .xlsm but .pdf extension)
So i need macro to read path and filename then save pdf with same name and path but with PDF extension
Here is my fixed path+name
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\Google Drive\Price enquiry\2020.10.28. House1\2020.10.28. House1.pdf"
===========================================================================
Sub LagrePDF()
'
' LagrePDF Macro
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\Google Drive\Price enquiry\2020.10.28. House1\2020.10.28. House1.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 595.7142519685, _
320.3571653543, 366.4285826772, 98.5714173228).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
"HUSK Å GI NYTT NAVN PÅ PDF"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).ParagraphFormat. _
FirstLineIndent = 0
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).Font
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorDark1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
.Size = 18
.Name = "+mn-lt"
End With
Application.Wait (Now + TimeValue("0:00:10"))
Selection.Delete
End Sub