hexagon logo

.exe that executes an Excel macro

Wish I had something like this years ago. First time venturing into VB.Net and gave this a try (I'm sure it can be done a million x's better, this gets my job done).

It's an executable that simply automates the pressing of a button that's in the Excel sheet (not sure who the author of the excel sheet is..thank you!). The Excel sheet works great on single part runs, it does not on LOOPS due to the macro only capturing data for the last part ONLY. Triggering the sheet from within PcD isn't possible either. I haven't had reasons to run LOOPs at my current employer so I haven't tested it but I do run it in single part programs that require no human intervention and it works as expected. If I had a LOOPed program I would simply place this
EXTERNALCOMMAND/NO_DISPLAY, WAIT ; C:\Users\Public\Documents\WAI\Excel_Report\Pcd2ExcelReport.exe
at the end of the LOOP. Or just use it on a single part program like I do.

Place the Sub folder in C:\Users\Public\Documents\WAI and LEAVE file names alone or else it won't work. Reference your PCDLRN in Excel VBA layout.

Again was my first (quick and dirty) try at VB.Net use at your own risk.

Attached Files
Parents
  • Sorry, I read it as END OF PROGRAM - it's a bit more tricky with LOOP/END. You can always catch the event ObjectExecuted() and check if it is a LOOP/END, assuming that's the only loop in the program. If not, you're in trouble...

    Oh, about that control program - sorry, it's a commercial product of Hexagon Metrology Nordic, so I can't share it as is. Parts of it, and ideas from it, can be found in other threads here on the forums.
Reply
  • Sorry, I read it as END OF PROGRAM - it's a bit more tricky with LOOP/END. You can always catch the event ObjectExecuted() and check if it is a LOOP/END, assuming that's the only loop in the program. If not, you're in trouble...

    Oh, about that control program - sorry, it's a commercial product of Hexagon Metrology Nordic, so I can't share it as is. Parts of it, and ideas from it, can be found in other threads here on the forums.
Children
No Data