Question about transferring data from EPI to cell in excel via 'execute' file command

I am pushing epi to the max, and now I want to push it just a little bit further.

I've been using epi as a defacto EMR-system for a pediatric HIV clinic in eastern Congo for two years.  I have now set up a 'patient charting' function via a excel macro that pulls specific metrics over time from the underlying access file for charting: CD4 counts, weight, etc...


Installing a commandbutton in the patients epi file that executes the excel file is easy enough. But there a way that I can transfer the "patient id" from epi view to the excel file (populate a cell in excel) so that I don't have to type in the 'patient id' a second time?




Views: 223

Replies to This Discussion



Is there no way, in the Excel macro, to also pull the patient ID into the Excel spreadsheet? Presumably it would also be stored in the underlying Access database.


To answer the question, though, there is no way to do this. The EXECUTE command can only run other programs. It might be possible to create an executable application that would know how to do this, in which case you would be able to call that application using EXECUTE; but creating such an application is far outside the scope of Epi Info and more into software development and computer programming.


Hi Christian,

Here is a solution.

Step 1. In Epi Info 3 CHECK CODE, define a permanent variable (e.g. "THIS_PatientID" and assign the patient Id field value to this permanent variable before the Execute statement to launch Excel.

When you use Epi Info ENTER, it will automatically update the INI file (typically located at c:\Epi_Info\EPIINFO.INI) with the permanent variable in the INI file's section "Variables".  For example:



Step 2. In your Excel file, add some Excel VBA code to read the value from the EPIINFO.INI file and insert it in a cell within the Excel sheet.

Attached is a working example with (1) Epi Info 3 mdb , (2) Excel file with example VBA code, and (3) screenshots showing where to enter VBA code in the Excel sheet. Unzip the file to C:\TEMP folder and open the mdb with Epi Info 3.5.  Move to any record and click the button to launch Excel -- that record's Patient ID will be automatically inserted into the Excel sheet.

Have a nice day!

Roy Ing


Looks like I never responded to your suggestion, it worked great, and thank you very much.



© 2015   Created by phConnect Admin.   Powered by

 |  Report an Issue  |  Terms of Service