01-16-2006 12:46 AM
01-16-2006 07:46 AM
Hi, you dont mention the method you use to connect to excell, so I assume you are using the CVI active X. controlls. I my experience using active X controlls you almost alway end up with issues moving between diffirent versions of excell even, and after exploring all the possibilities I ended up writing to .csv files or I navively write my own excell file using the formats reverse engineered by third parties and the access that from excell. This ensures that I am in conroll of the format and any future versions of excell supports that.
Excell can also interpret XML, so you can always generate th report in XML instead:
The basic format is like this:
<?xml version="1.0" encoding="UTF-8"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Table1">
<Table>
<Column ss:Index="1" ss:AutoFitWidth="0" ss:Width="110"/> <Column ss:Index="2" ss:AutoFitWidth="0" ss:Width="110"/> <Column ss:Index="3" ss:AutoFitWidth="0" ss:Width="110"/> <Column ss:Index="4" ss:AutoFitWidth="0" ss:Width="110"/> <Row>
<Cell><Data ss:Type="String">Date</Data></Cell>
<Cell><Data ss:Type="String">Time</Data></Cell>
<Cell><Data ss:Type="String">Debug</Data></Cell>
<Cell><Data ss:Type="String">Comment</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">MCL Command=STA</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">Command Reply=000C</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">LogMessage: Robot GetWafer Procedure Completed</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">MCL Command=CCD 3</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">Command Reply=0</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">2005-09-09</Data></Cell>
<Cell><Data ss:Type="String">10:46:06</Data></Cell>
<Cell><Data ss:Type="String">MCL Command=SVN</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
This is really cool, but not widely published.
best regards
Jattie
01-17-2006 04:01 PM
Jattie,
Thanks for the very useful approach to Excel via XML. Hopefully it helps the original poster too.
I am more and more convinced that it is risky to rely on another software package of a particular version being installed on the target machine, given I have no say in the management of my end-user's computers. Using XML seems to be the most generic, open and future-proof method.
But I do need to know how your example works: I was pleased that my lowly Excel 2002 could open and understand that XML file. The mystery to me are the schemas in the first few lines:
Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
Where does my Excel read those schemas from? How certain am I that any machine has/has access to them? Any insights or links (esp. pre-Office 2003) appreciated.
Thanks
Ian
P.S. Anyone know how to stop this editor from making faces out of the colon and lower case "O"?
01-23-2006 12:14 AM
I thank for your replies, but I need to know if there are problems by using activeX communication between excel and CVI when a user has a version of MSExcel that does not use european alphabet....
Thanks to all of you will want ask me.
Bye.
Andrea
01-23-2006 04:52 AM
Hi Ian,
IU am sorry, but I just use the template as it is, I did'nt bother to find out why it is the way it is. I also opened it with office 2000 version of excell, so it seems that excell understands xml for quite some time now, but you never really now what the relationships is between the microsoft apps. XML is actually a module that is installed with IE, so it might not even be down to excell but rather dependent on the current version of IE on the machine.
Peo,
I tried to answer your question with my previous reply and gave you some options to get around the problems. The short version of the answer is that activeX works diffirent between diffirent versions of the application and this changes without warning. There is no gaurentee that your application will work with a diffirent alphabet and the only way you will now for sure is to try it. The danger of it thou is it will most defenately not work once they upgrade to another version of the product. This happende to me countless times and that's why I changed my approach.
01-23-2006 09:37 AM
Andrea,
Sorry if I got things off-track for you regarding localized versions of Excel.
Perhaps if you can post a simple test project, some kind soul can test it on an appropriate PC.
Otherwise the answer may be buried in MSDN; this is the closest I could come http://msdn2.microsoft.com/en-us/library/ms178762.aspx .
Finally, I can only echo Jattie's concern: watch out for different object models in different versions of Excel, and try to ensure that the user machine has the same version of Excel, just localized. For instance here is a page on changes in the Excel object model between the 2000 & 2002 versions: http://support.microsoft.com/default.aspx?scid=kb;en-us;293809
Good luck.
--Ian