Looping with pdf-printing

M

Mia

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
 

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