Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Skip Excel messages in automation (VBA/Excel/Powerpoint/Word)

    Hi guys!

    I am glad to be back after a long time!
    Ok, I have a problem... and I hope you guys can help me (as usual!)

    I have a program that processes hundreds of excel files (and powerpoint and word). It takes some information from them, and store it in a database. This processing
    is done automatically, without interact with the user. The problem that I have is that when some files, Excel asks something to the user. ex:

    - 'Myfile.xls' cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document
    is stored on may not be responding (Retry/Cancel)

    - 'Myfile2.xls' should be opened as read-only unless you need to save changes to it. Open as read-only? (Yes/No/Cancel)

    So, if my customer leaves the program running at night, when he comes in the morning, he will see that processing stopped in that file, asking him
    to do something

    Is there anyway to skip these messages or to choose a default value?

    In the past, I got rid of other messages compiling with this NO_PROMPT_ON_HRCHECK_FAILURE;NO_PROMPT_ON_ASSERTE_ FAILURE, but I think that
    this time has nothing to do with that

    Thanks a lot for you help!!

    Luis

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Skip Excel messages in automation (VBA/Excel/Powerpoint/Word)

    It depends on the application.

    To give the "default" reply to Word or Excel or PowerPoint dialog boxes automatically, insert Application.DisplayAlerts = False. Make sure that you set it to True after processing the files, for it won't be turned on automatically within a session.
    To give the "default" reply to Access dialog boxes automatically, insert DoCmd.SetWarnings False. Make sure that you call DoCmd.SetWarnings True after processing the files.

    You 'll probably have to set error handling too, to skip processing a file if it can't be opened.

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Skip Excel messages in automation (VBA/Excel/P

    <LI>Missing files: What level of error checking do you want to have for missing files? <LI>Read Only warnings [Excel] - after the code indicating Filename.Open add ", IgnoreReadOnlyRecommended :=True" [without the quotes]
    Gre

  4. #4
    Star Lounger
    Join Date
    Apr 2002
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Skip Excel messages in automation (VBA/Excel/Powerpoint/Word)

    Thanks a lot for your detailed answer. I'll will try that.

  5. #5
    Star Lounger
    Join Date
    Apr 2002
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Skip Excel messages in automation (VBA/Excel/P

    Thanks for your help!!
    I'll try that option when opening files.

    By the way:

    > Missing files: What level of error checking do you want to have for missing files?

    Is there anyway to specify a level? I just want to have a log file where the user can check if the file had any problem when trying to process.
    For example, if the file cannot be opened for any reason, that file will be skipped and the next file in list will be processed. The log file should reflect that problem.

Posting Permissions

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