+ Reply to Thread
Results 1 to 6 of 6

Boolean in VBA are returned in local language

  1. #1

    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


  2. #2
    Nigel
    Guest

    Re: Boolean in VBA are returned in local language

    If Not CStr(bolVal) then


    --
    Cheers
    Nigel



    <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  3. #3
    Nigel
    Guest

    Re: Boolean in VBA are returned in local language

    Sorry forgot to remove the Cstr conversion.........try this

    If Not bolVal Then

    --
    Cheers
    Nigel



    "Nigel" <[email protected]> wrote in message
    news:%[email protected]...
    > If Not CStr(bolVal) then
    >
    >
    > --
    > Cheers
    > Nigel
    >
    >
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > 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
    > >

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: 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)

    <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  5. #5

    Re: 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)
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > 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
    > >



  6. #6
    Registered User
    Join Date
    11-07-2013
    Location
    mumbai, india
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Boolean in VBA are returned in local language

    Hi,
    I tried following in VBA immediate window.

    ?"true" = true
    True
    ?"false" = false
    True
    ?"false" = true
    False
    ?"true" = false
    False
    ?"false" = true
    False

    I hope this will help.

    but following shows Type Mismatch error
    ?"" = true
    ?"" = false


    Thank you,

    rahul_var

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1