Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    23

    Unanswered: prevent 2nd macro from executing until WinZip from RunApp is closed

    Hi fellows,

    I'm using Access2002.

    In my first macro I use RunApp to open the WinZip32.exe to extract 2 text files (zmcr003s.txt and zmcr003m.txt) from the zipped file. The command is "C:\Program Files\WinZip\WINZIP32.exe"
    In my 2nd macro I use TransferText to import the text file "zmcr003s" to Access Table called "AMSEA".
    In my 3nd macro I use TransferText to import the text file "zmcr003m" to Access Table called "AMEA".
    In my 4th macro I program the 1st, 2nd and 3rd macros to run in that sequence.


    (1) Now, how should I code it such that the 2nd macro can only start to run when the active WinZip application is closed ?

    (2) I wonder is there a code or other possible ways to program WinZip to open, automatically extract the text file "zmcr003s.txt" from "D:\inventory\zmcr003s12Oct2004.zip" to "G:\Scorecard\Inventory\zmcr003s.txt" ?

    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Posts
    533
    (1) Now, how should I code it such that the 2nd macro can only start to run when the active WinZip application is closed ?
    You could use an API or windows script to check for the Winzip application window. Use a while loop to keep checking until the active application is false.

    Another idea create a loop to check for the existence of your files. Your script will start by deleting the existing files then run winzip and extract, next loop and check for the files, to proceed when the files exists.

    (2) I wonder is there a code or other possible ways to program WinZip to open, automatically extract the text file "zmcr003s.txt"
    You could use windows Task Scheduler to run Winzip at a specific time each day to extract the files. If you can't get it to work with Winzip create a script to do it through Excel and have scheduler run the Excel workbook.


    .
    ~

    Bill

Posting Permissions

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