LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Localized version of Excel

Hello everybody, I have an application that links to Excel to make reports of certain acquired data and it works fine. Now, the customer for which I wrote this application, which exports his products to countries where they don't use european alphabet, asked me the behaviour of my application with other version of excel. For example, what happens when I write into a cell with the function of excelreport.fp and I use the reference "A1" to write in the first cell of a sheet?
Thanks
Regards
 
Andrea
0 Kudos
Message 1 of 6
(3,670 Views)

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

 

Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
Message 2 of 6
(3,682 Views)

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"?

 

 

0 Kudos
Message 3 of 6
(3,632 Views)

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

0 Kudos
Message 4 of 6
(3,600 Views)

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.

 

Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 5 of 6
(3,585 Views)

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

0 Kudos
Message 6 of 6
(3,578 Views)