+ Reply to Thread
Results 1 to 2 of 2

Need help while saving the file

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Post Need help while saving the file

    Hi I have the below macro to save the file in a pirticular location and i need help in overwriting the file if it is saving for the next time.
    Sub export()
    
    Worksheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet5", "Sheet6")).Copy
    
    Set wbNew = ActiveWorkbook
    With wbNew
        ActiveWorkbook.SaveAs Filename:="D:\Documents and Settings\Kishore\My Documents\SPlit" & "\001.xls"
        Application.DisplayAlerts = True
        .Close
        
    
    End With
    End Sub

  2. #2
    Registered User
    Join Date
    04-09-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Need help while saving the file

    kishoremcp,

    Try this:
    Sub export()
    
    Worksheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet5", "Sheet6")).Copy
    
    Set wbNew = ActiveWorkbook
    With wbNew
        Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs Filename:="D:\Documents and Settings\Kishore\My Documents\SPlit" & "\001.xls"
        Application.DisplayAlerts = True
        .Close
        
    
    End With
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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