Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Confirm save file

Hello to you all happy new year.

In my code below i dont get the security alert which tells me that i'm gonna
overwrite an existing file name. Can someone help me modify this code to
display the security alert.

Sub PrintToFile()
'This example publish the first two pages of the ActiveSheet
'You can change the from and To to only publish the pages you want
Dim FilenameStr As String

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

FilenameStr =
Application.GetSaveAsFilename(FileFilter:="DecProF ile(*.pdf), *.pdf",
InitialFileName:=Trim(Workbooks("Declaration
Pro.xls").Worksheets("Front").Range("B4").Value))
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
From:=1, _
To:=Worksheets("front").Range("G6").Value, _
OpenAfterPublish:=False
MsgBox "You can find the PDF file here : " & FilenameStr
Else
MsgBox "PDF add-in Not Installed, Contact /2257778
for installation file"
End If
End Sub

Thanks in Advance
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
Stopping the confirm popup on file save with same name Chartsmalm[_2_] Excel Programming 4 August 11th 07 11:38 PM
dont confirm save with yes/no/cancell pswanie Excel Programming 2 June 18th 07 05:56 PM
After Save Event - Confirm Steph[_6_] Excel Programming 11 October 27th 05 09:43 PM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Saveing a file (Confirm Replace) rudolpsh[_5_] Excel Programming 4 January 26th 04 11:04 AM


All times are GMT +1. The time now is 07:49 AM.

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

About Us

"It's about Microsoft Excel"