Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Looping and saving pdf

I hope someone can help me with this. I am trying to save pdf-files
togetherwith looping. The reason is that only specified documents should be
saved. I´ll be grateful for your help. My code so far is as follows.

BR
Mia



Sub bevispdfttest()
'
' Spara som pdf i mapp Makro
'

Dim FilenameStr As String
Dim Start As Integer
Dim Stopp As Integer
Dim SkrivUt As String

Sheets("Kunddata").Select
Start = Range("C11").Value
Stopp = Range("C12").Value


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

Sheets("Faktura").Select


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

FilenameStr = "P:\Testmapp\" & _
ActiveSheet.Range("G6").Value & " " & Format(Now, "yyyy-mm-dd") &
".pdf"

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

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
Looping Maggie[_6_] Excel Discussion (Misc queries) 6 October 2nd 08 09:14 PM
Saving a spreadsheet without saving the Macro tedd13 Excel Programming 7 March 31st 06 02:17 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM
Looping Stuart[_9_] Excel Programming 0 October 29th 03 11:31 PM


All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"