this piece of code was used in the delphi 5 program, which I was debugging:
s:string
vararray:variant;
vararray := VarArrayOf(['']);
vararray := ExcelWorkSheet1.UsedRange[0].Value;
s := VarToStr(vararray);
This works great when working with Excel XP and 2003. But since I switched to Excel 2007 (also Windows7), delphi gives a variant type conversion error on the last line ("Incorrect variant type conversion").
Can someone please help me with this? This code has not been affected over the past 5 years, and I cannot find a good source that documents these components.
thank!
source
share