Delphi/Excel connection problems
Posted on 2007-11-17
I am connecting through ADO Connection and Query to Excel workbook. I have two problems.
1/ The Excel workbook comes to me with spaces in the column titles. Within Delphi is it possible to delete the spaces or change the column names?
2/Having changed the Excel column names manually, I am able to connect and sort the workbook sheets. The workbook appears in a connected DBGrid. However, when I run the following code adoquery1.first; X:=adoquery1['fieldname'].Asstring; label1.caption:=x; I get the following error "Variant does not reference an automation Object' So I need solutions to these two problems, please.