Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
How can I get data from an open Excel workbook?
There is an application that interfaces to a Gas chromatograph that analyzes a gas sample and stores readings to a log file or stores the readings into an open Excel workbook. I can get the data from the log file once it is written but the problem is that the program only writes the log file when you stop the process and manually save the log file then restart the process. It can be programmed to writes the data to an open excel workbook, but the problem with this is that it writes to the the same cells every time it writes (every 4 minutes). When this is a batch process that is attended it is easy to stop the process and save the log file and put this intop a table for calculations. I now have the need to run this as a continuous process for a period of several weeks and automatically capture the data when it is written to the excel workbook and save it to another table since it is continuously overwritten in the workbook.
I can use a timer to get the data every 4 minutes, but I don't know how to automate excel and capture data from an open workbook. How can I access the open file in Excel (GCTEST.XLS) to capture the data that is being written without affecting the process that is writing to it? I need to detect that Excel is running and GCTEST.XLS is the current workbook and capture the readings from cells a2 and b2 every 4 minutes before it is overwritten by the next reading.
TIA
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement