Can someone please post a code example of how to read from and write to particular cells in MS Excel documents? And does the excel report have an NC-only option like the basic reports do?
I tested this and I don't think this is possible to write sometime directly to a specific Excel cell from PC-DMIS FILE I/O (such as FILE/OPEN & FILE/WRITE commands). I think you'd have to get involved with some kind of Excel VBA scripting.
With PC-DMIS FILE I/O commands, you can only pretty much write only to simple text files (ie files that you can open inside of a standard text editor, like Notepad. However, after some experimentation, I was able to write to an .xls--but not not .xlsx--extension, but Excel was giving me "The file could be corrupted or unsafe" messages and when I agreed to open it anyway, I was only able to get the data into the first column, not a specific cell.)
Your might want to consider writing to a CSV (Comma Separated Value) file and then inside a blank Excel worksheet, import the CSV file into different columns / rows (from Excel's ribbon, choose
Data, then
From Text/CSV).
I tested this and I don't think this is possible to write sometime directly to a specific Excel cell from PC-DMIS FILE I/O (such as FILE/OPEN & FILE/WRITE commands). I think you'd have to get involved with some kind of Excel VBA scripting.
With PC-DMIS FILE I/O commands, you can only pretty much write only to simple text files (ie files that you can open inside of a standard text editor, like Notepad. However, after some experimentation, I was able to write to an .xls--but not not .xlsx--extension, but Excel was giving me "The file could be corrupted or unsafe" messages and when I agreed to open it anyway, I was only able to get the data into the first column, not a specific cell.)
Your might want to consider writing to a CSV (Comma Separated Value) file and then inside a blank Excel worksheet, import the CSV file into different columns / rows (from Excel's ribbon, choose
Data, then
From Text/CSV).