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.
Problem with Update Statement In EXCEL when variable has an apostrophe
I am trying to update an element into an excel sheet. The problem is that the element has an " ' " in between which is restricting me from updating into excel.
CODE:
var $UpdateDB = "update [Sheet1$] set ItemName ='" + $Temp + "'" + " where RowNumber = " + $i ;
_alert($UpdateDB);
db.update($UpdateDB);
RESULT:
The statement is coming as :
_alert("update [Sheet1$] set ItemName ='$250 Ruth's Chris Steak House' where RowNumber = 6");
The "$250 Ruth's Chris Steak House" has a apostrophe(Ruth's) in the word so its not storing into excel. If the same $Temp doesn't have a apostrophe its storing to excel.
Can someone help me out
CODE:
var $UpdateDB = "update [Sheet1$] set ItemName ='" + $Temp + "'" + " where RowNumber = " + $i ;
_alert($UpdateDB);
db.update($UpdateDB);
RESULT:
The statement is coming as :
_alert("update [Sheet1$] set ItemName ='$250 Ruth's Chris Steak House' where RowNumber = 6");
The "$250 Ruth's Chris Steak House" has a apostrophe(Ruth's) in the word so its not storing into excel. If the same $Temp doesn't have a apostrophe its storing to excel.
Can someone help me out
Comments
Thanks