18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Write excel with an integer as reference
I had the below .xls file:
SNo Scenario Result
a xyz Pass
I had the code: db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>a<sq><dq>);
and the .xls file was updated as below:
SNo Scenario Result
1 updated Text Pass
Then I changed the setup like below:
SNo Scenario Result
1 xyz Pass
I had the code: db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>1<sq><dq>);
The .xls file was not updated. Any clue?
SNo Scenario Result
a xyz Pass
I had the code: db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>a<sq><dq>);
and the .xls file was updated as below:
SNo Scenario Result
1 updated Text Pass
Then I changed the setup like below:
SNo Scenario Result
1 xyz Pass
I had the code: db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>1<sq><dq>);
The .xls file was not updated. Any clue?
This discussion has been closed.
Comments
Can you try this:
db.update("update [Sheet1$] set Scenario='updatedText' where SNo='1'");
Check if this solves your issue.
For more details about working with Excel sheet:
http://sahi.co.in/w/working-with-excel-sheets
If you still are not able to update the xls file then let me know what is the error message you are getting.
Regards
Sumitra
I tried - db.update("update [Sheet1$] set Scenario=updatedText where SNo='1'"); and it did not work for me.
I had referred:
http://sahi.co.in/w/working-with-excel-sheets
which do not support to solve my issue.
I do not get any error message while using:
db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>1<sq><dq>);
but the file is not updated.
However the file gets updated while using:
db.update(<dq>update [Sheet1$] set Scenario=<sq>updatedText<sq> where SNo=<sq>a<sq><dq>);
which is not my requirement. Any more clue?
Use the following code:
Create an excel file on
SNo Scenario Result
1 abc Pass
Now, if you run the script you can see that the Excel sheet will be updated.
Let me know if this solves your issue.
Regards
Sumitra
db.update("update [Sheet1$] set Scenario='UpdatedText' where SNo=1");
works fine.