Results 1 to 3 of 3

Thread: RESOLVED To know when excel is done saving

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2000
    Location
    Montréal, Québec Canada
    Posts
    202

    RESOLVED To know when excel is done saving

    Hail,

    I am currently experiencing a problem and it seems to be related to excel being in "save mode".
    Basically, the application saves an excel file to a server and then saves a text file to the same server. In the meantime, a process from an outside application runs every few minutes to see if a text file exists (the one saved from above), if it finds one, it basically uses the information within to print the inofrmation within the excel file. Tihs works very well except from time to time, when it attempts to print the excel file, I get a message on the server requesting to open the file in read only because it is being modified by the user who originally saved the file. I have two solutions in mind but can't figure out how to do them in code.

    1. If I could get rid of that message and have excel open it in read-only automatically, I'd be ok. Unfortunately, I tried saving the file in read-only but it doesn't work (maybe because it's not done saving) and I can't figure out how to get rid of this message (Read Only, Notify or Cancel message) so I don't think this option is viable

    2. Would there be a way like for Word when you validate if word is still printing/saving for excel something like backgroundsavingstatus? What I'd do in the app is save the file, check to see if it's done and only then save the text file which would ensure the file does not require read only status...

    If anyone can help, I'd appreciate it...

    Thanks

    Phailak
    Last edited by Phailak; Oct 15th, 2003 at 09:42 AM.

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    You can open a file readonly like this:

    VB Code:
    1. Workbooks.Open Filename:="C:\My Documents\A1.xls", ReadOnly:=True
    But if you open it during a save, the file that you open wil probably be the file before the changes were saved.

    You can check to see if a workbook has been saved using the Saved method:

    VB Code:
    1. Do Until ActiveWorkbook.Saved
    2.     Loop
    Then save your text file.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2000
    Location
    Montréal, Québec Canada
    Posts
    202

    Resolved

    Hail,

    Worked with .saved property, thanks

    Phailak

Posting Permissions

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



Click Here to Expand Forum to Full Width