+ Reply to Thread
Results 1 to 7 of 7

Problem with File Available For Editing popup..

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Problem with File Available For Editing popup..

    Hi,

    I just wonder, I am using this VBA to open a file from a folder:

    Dim excel As excel.Application
    Dim wb As excel.Workbook
    Dim sht As excel.Worksheet
    Dim f As Object

    Set f = Application.FileDialog(3)
    f.AllowMultiSelect = False
    f.Show

    Set excel = CreateObject("excel.Application")
    Set wb = excel.Workbooks.Open(f.SelectedItems(1))
    Set sht = wb.Worksheets("Sheet1")
    Rows("1:999").Select
    Selection.Delete Shift:=xlUp
    sht.Activate
    sht.Columns("A:L").Copy
    Range("A1").PasteSpecial Paste:=xlPasteValues

    Call Fre_Value
    and then, I use this one to save as the file:
    Dim save_as As Variant
    Dim file_name As String
    Dim ProgramName As String
    file_name = ProgramName
    ' Get the file name.
    save_as = Application.GetSaveAsFilename(file_name, _
    FileFilter:="Excel Files,*.xlsx,All Files,*.*")
    ' See if the user canceled.
    If save_as = False Then Exit Sub
    ' Save the file with the new name.
    Application.DisplayAlerts = False
    If LCase$(Right$(save_as, 4)) <> ".xlsx" Then
    file_name = save_as & ".xlsx"
    End If
    ActiveWorkbook.SaveAs Filename:=save_as, FileFormat:= _
    xlOpenXMLWorkbook, CreateBackup:=False
    However, when I reopen that macro file, there is a popup for File Available to Edit, or the file that has been executed by the macro keep reopening behind.

    What am I missing in these code?

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Problem with File Available For Editing popup..

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Problem with File Available For Editing popup..

    Where should I integrate that code?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Problem with File Available For Editing popup..

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Problem with File Available For Editing popup..

    Genius! Thank you very much!

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Problem with File Available For Editing popup..

    you can optimize your code with
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Problem with File Available For Editing popup..

    Quote Originally Posted by patel45 View Post
    you can optimize your code with
    Please Login or Register  to view this content.
    Why Application.DisplayAlerts = False is not required in this optimized code?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 09-06-2013, 05:31 AM
  2. Replies: 2
    Last Post: 11-28-2012, 12:52 PM
  3. Popup Calendar Problem
    By tepraco in forum Excel General
    Replies: 1
    Last Post: 03-31-2011, 04:59 PM
  4. Popup calendar problem
    By Temporary-Failure in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2010, 12:58 PM
  5. Replies: 0
    Last Post: 03-19-2005, 02:06 PM

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