Forum Discussion
A_Roskoshnyi
Contributor
Take a look at this example (C#Script):
var fileName = "Y:\\Automation\\Automation\\Testscenario's\\Timings.xlsx";
var excel = Sys["OleObject"]("Excel.Application");
excel["Workbooks"]["Open"](fileName);
excel["Sheets"]("YOUR_SHEET_NAME")["Select"]();
excel["Cells"](1,1)["Font"]["Color"] = dotNET["System_Drawing"]["ColorTranslator"]["ToOle"](dotNET["System_Drawing"]["Color"]["Red"]);
excel["Cells"](1,1)["Value"] = feature["Tags"]["Item"](0);
excel["Cells"](1,2)["Font"]["Color"] = dotNET["System_Drawing"]["ColorTranslator"]["ToOle"](dotNET["System_Drawing"]["Color"]["DarkOrange"]);
excel["Cells"](1,2)["Value"] = aqDateTime["Today"]();
excel["ActiveWorkbook"]["Save"]();
excel["Quit"]();
sonya_m
3 years agoSmartBear Alumni (Retired)
Thanks a lot, everyone! What a great discussion.
hannecroonen how did you solve this in the end? Please share🙂
- hannecroonen3 years agoContributor
Hi, I have not solved it yet, tried all of the above but it does not seem to work for me as it should... I don't know which cells need color beforehand so I could not really use the solutions above.