ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping with pdf-printing (https://www.excelbanter.com/excel-programming/421105-looping-pdf-printing.html)

Mia

Looping with pdf-printing
 
Hello,

I´m have earlier made a vba-programming for printing (looping).
Now I´m trying to do the same and to save all prints at the same place
like pdf. Do anyone know what I have done wrong? I´l be wery grateful
for your help. Se my code below.

Br
Mia

Sub Skrivpdftest()
'
' Skriv Makro
' Makrot inspelat 2006-11-28 av F


Dim Start As Integer
Dim Stopp As Integer
Dim SkrivUt As String
Sheets("Kunddata").Select
Start = Range("C10").Value
Stopp = Range("C11").Value

For i = Start To Stopp
Sheets("Kunddata").Select
Range("C12").Value = i
SkrivUt = Range("F12").Value
If SkrivUt = "S" Then

If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _
& Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then

FilenameStr = "M:\Försäkringsbevis\" & _
ActiveSheet.Range("b4").Value & ".pdf"

Sheets("Faktura").Select

ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=Prewiev

Sheets("Faktura").Select


Next
Sheets("Kunddata").Select
End If
End Sub


All times are GMT +1. The time now is 04:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com