Boolean in VBA are returned in local language
Hi,
My VBA script reads some values from cells and sends them to a webservice. I just realized that using a German Excel e.g. cell.Font.Strikethrough is returned as Wahr/Falsch instead of True/False. I tried following code snippet I found online but unfortunately didn't help either: ...... Dim bolVal As Variant bolVal = cell.Font.Strkethrough If CStr(bolVal ) = "False" Then ' Unfortunately this didn't help. ........ Has anybody an idea how to convert this from any language to True/False? Reto |
Boolean in VBA are returned in local language
If Not CStr(bolVal) then
-- Cheers Nigel wrote in message oups.com... Hi, My VBA script reads some values from cells and sends them to a webservice. I just realized that using a German Excel e.g. cell.Font.Strikethrough is returned as Wahr/Falsch instead of True/False. I tried following code snippet I found online but unfortunately didn't help either: ..... Dim bolVal As Variant bolVal = cell.Font.Strkethrough If CStr(bolVal ) = "False" Then ' Unfortunately this didn't help. ....... Has anybody an idea how to convert this from any language to True/False? Reto |
Boolean in VBA are returned in local language
Sorry forgot to remove the Cstr conversion.........try this
If Not bolVal Then -- Cheers Nigel "Nigel" wrote in message ... If Not CStr(bolVal) then -- Cheers Nigel wrote in message oups.com... Hi, My VBA script reads some values from cells and sends them to a webservice. I just realized that using a German Excel e.g. cell.Font.Strikethrough is returned as Wahr/Falsch instead of True/False. I tried following code snippet I found online but unfortunately didn't help either: ..... Dim bolVal As Variant bolVal = cell.Font.Strkethrough If CStr(bolVal ) = "False" Then ' Unfortunately this didn't help. ....... Has anybody an idea how to convert this from any language to True/False? Reto |
Boolean in VBA are returned in local language
Why not test the boolean directly
Why not test the Boolean directly Dim bolVal As Variant bolVal = cell.Font.Strkethrough If bolVal = FALSE Then -- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... Hi, My VBA script reads some values from cells and sends them to a webservice. I just realized that using a German Excel e.g. cell.Font.Strikethrough is returned as Wahr/Falsch instead of True/False. I tried following code snippet I found online but unfortunately didn't help either: ..... Dim bolVal As Variant bolVal = cell.Font.Strkethrough If CStr(bolVal ) = "False" Then ' Unfortunately this didn't help. ....... Has anybody an idea how to convert this from any language to True/False? Reto |
Boolean in VBA are returned in local language
Thanks both of you. That helped.
Regards, Reto Bob Phillips wrote: Why not test the boolean directly Why not test the Boolean directly Dim bolVal As Variant bolVal = cell.Font.Strkethrough If bolVal = FALSE Then -- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... Hi, My VBA script reads some values from cells and sends them to a webservice. I just realized that using a German Excel e.g. cell.Font.Strikethrough is returned as Wahr/Falsch instead of True/False. I tried following code snippet I found online but unfortunately didn't help either: ..... Dim bolVal As Variant bolVal = cell.Font.Strkethrough If CStr(bolVal ) = "False" Then ' Unfortunately this didn't help. ....... Has anybody an idea how to convert this from any language to True/False? Reto |
All times are GMT +1. The time now is 11:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com