| || |
Reading / Writing one specific cell of an excel
I am trying to update one specific cell of an excel file. I am able to connect to the xls using the Excel Driver. I am also able to update data within the file but only by accessing cells with their field name (name of the first row of that colomn).
What I need, however, is to access one cell only - e.g. Sheet1$A1 - and update its contents.
[ ] hDBC = DB_Connect ("DRIVER=Microsoft Excel Driver (*.xls); READONLY=FALSE;DBQ=C:\test_excel.xls;")
[ ] hSQL = DB_ExecuteSQL (hDBC, "UPDATE [SHEET1$] SET Fieldxc ='Ja' ")
[ ] DB_Disconnect(hDBC)
I tried to use firstrowhasnames=0 because it supposedly names the fields (rows) automatically (F1, F2, etc). Unfortunenately, due to a known bug, firstrowhasnames is ignored and thus has no effect on the way the first row of an excel file is treated.
Is there a way to solve this problem? Any help is greatly appreciated!
Re: Reading / Writing one specific cell of an excel
Silktest is treating Excel as DB. In this case, I hope the query should be modified.
Otherwise you can use VB script..