none
Difference of behavior for autofilter. RRS feed

  • Question

  • Hello,

    I am french develloping a small apply with VSTO for Excel.

    I developped it on a PC having W7 32 and office 2010 with VisualStudio 2015. (All in English).

    When I test it on the W7 computer Autofilter works as expected.

    When I test it after installation on W10 X64 with Office 2013(All in French) X64 Autofilter does not work as expected. Some other features were working as expected. I did not test all of them thoroughly.

    All on the same excel spreadsheet. Do you have any ideas?

    I would like to do that since other people of our association will be using it.

    Regards,

    Guy.

    RgeFamilles.Rows(1).hidden = False
    MonWorkbook.Worksheets("ZZZ-2016").copy(Before:=MonWorkbook.Worksheets
    ("ZZZ-2016"))
    WrkSheet = MonWorkbook.Worksheets("ZZZ-2016 (2)")
    WrkSheet.Name = NomJoueurs.SelectedItem
    WrkSheet.Visible = True
    WrkSheet.Select()
    ' RgeFamilles.AutoFilter()
    WrkSheet.Range("PereNom").Select()
    Me.Close()
    End Sub
    Private Sub FRechercheJoueur_Load(sender As Object, e As EventArgs) Handles
    MyBase.Load
    Const ClNom As Int32 = 2
    Const ClCetteAnnee As Int32 = 6
    Dim WrkSheet As Excel.Worksheet
    Dim RgeFamilles As Range
    WrkSheet = Globals.ThisAddIn.Application.Worksheets("Familles")
    WrkSheet.AutoFilterMode = False
    RgeFamilles = WrkSheet.Cells.CurrentRegion
    RgeFamilles.AutoFilter(ClCetteAnnee, False)
    RgeFamilles.Rows(1).hidden = True
    For Each ligne In RgeFamilles.SpecialCells
    (XlCellType.xlCellTypeVisible).Rows
    NomJoueurs.Items.Add(ligne.cells(ClNom).value)
    Next
    RgeFamilles.Rows(1).hidden = False
    ...udio 2015\Projects\TTOutils\TTOutils\RechercheJoueur.vb 2
    End Sub
    End Class

    Wednesday, August 17, 2016 5:19 PM

Answers

  • Hi,

    sorry it tooks me some time to answer.

    Filter was in the code window, see below!

    Instead of using boolean False/True in english Faux/vrai in french. I used a string and compare to a defined caractter.

    May be I will do some trials later to find a way using boolean which ever is the language.

    Anyway thanks for communicating.

    Guy.

    RgeFamilles.AutoFilter(ClCetteAnnee, False)
    Sunday, August 28, 2016 1:43 PM

All replies

  • Hello,

    Did you try to debug the code? Do you get any exceptions? If so, what property or method call fires an exception?


    [custom.development]

    Wednesday, August 17, 2016 5:57 PM
  • Hi,

    thanks for asking.

    At this time, there are no exceptions. I am suspecting that it is a language issue since, I develop on an english system where it works.

    The filter is on TRUE/FALSE in english within cells on a speadsheet. When loaded in French the sheet has VRAI/FAUX which is the direct translation.Searching internet seems to tell that language change has to be manage in VSTO.

    At this time, I have not understand yet how.

    I am thinking to move out of the TRUE/FALSE use.

    Guy.

    Thursday, August 18, 2016 6:59 AM
  • Hi every body,

    on the french system in the excel spreadsheet I replase faux by false and got the behavior I was expecting.

    Do I have to change to Something specific and avoid true/false or there is some other way to have the same add-in working with both languages.

    Guy.

    Thursday, August 18, 2016 4:56 PM
  • Hi Guy,

    >>on the french system in the excel spreadsheet I replase faux by false and got the behavior I was expecting.

    Based on your original code, I did not find you set filter with “false”. Could you share us where you set it, or where you use “false/true” which make your Autofilter not work?

    >>on the french system in the excel spreadsheet I replase faux by false and got the behavior I was expecting

    If you set “faux” instead of “false” in VSTO, will it work for you? I agree with you, it seems to be caused by language.

    For one way, I think you could try to replace string with language culture, you could refer the link below:

    #Localize Office add-in based on Office language pack in use rather than Windows' current language

    http://stackoverflow.com/questions/8013658/localize-office-add-in-based-on-office-language-pack-in-use-rather-than-windows

    For another way, I think you could try to set thread culture, you could refer the link below:

    #VSTO Windows 7 Visual Studio 2010 Word 2007 culture does not match Addin Culture

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/5144a993-c91a-4ec8-a94d-3aa8df64a5cd/vsto-windows-7-visual-studio-2010-word-2007-culture-does-not-match-addin-culture?forum=vsto

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, August 19, 2016 1:58 AM
  • Hi,

    sorry it tooks me some time to answer.

    Filter was in the code window, see below!

    Instead of using boolean False/True in english Faux/vrai in french. I used a string and compare to a defined caractter.

    May be I will do some trials later to find a way using boolean which ever is the language.

    Anyway thanks for communicating.

    Guy.

    RgeFamilles.AutoFilter(ClCetteAnnee, False)
    Sunday, August 28, 2016 1:43 PM
  • Hi Guy,

    Do you mean your issue has been resolved by "a string and compare to a defined caractter."? If you have, I would suggest you mark your reply as answer, and then others who run into the same issue would find the solution easily. If not, please feel free to let us know, and we will provide our best help.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, August 29, 2016 6:24 AM