Results 1 to 5 of 5

if file exist macro problem

Threaded View

  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    izmir
    MS-Off Ver
    Excel 2010
    Posts
    3

    if file exist macro problem

    hi.
    i have a macro that saves as an excel file with the name composed of some cells from the activesheet.
    in fact it works fine.
    but i'd like the code check if the file and and then do what it needs to do but i couldnt succeed.

    could someone help me to correct what ever wrong in this code ?

    altough the file exists the below code do not givee me the message.

    Sub pdfolarakkaydet()
    
    fname = ActiveSheet.Range("D11") & ActiveSheet.Range("D15") & ActiveSheet.Range("D10")
    If Dir("G:\GOOGLE DRİVE\SPRİNGSOURCİNG\renk çalışmaları foto\TEST SAPORLARI\fname.pdf") <> "" Then
            MsgBox "File exists!"
        Else
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
            "G:\GOOGLE DRİVE\SPRİNGSOURCİNG\renk çalışmaları foto\TEST SAPORLARI\" & fname, _
            Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
            :=False, OpenAfterPublish:=False
            End If
    End Sub
    Last edited by etuzgen; 03-18-2014 at 06:23 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save as macro; File allready exist
    By tigergutt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2013, 09:15 AM
  2. Have macro over write existing file from control button if file exist
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2011, 10:35 AM
  3. Replies: 3
    Last Post: 05-15-2006, 05:00 AM
  4. Replies: 3
    Last Post: 03-11-2006, 02:50 PM
  5. Replies: 0
    Last Post: 03-10-2006, 05:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1