none
convert VBA to vb.net or VB6

    Question

  • I am new to using Visual Studio and I have a simple VBA module that calls a form that allows the user to select a row that sets a header filter and colors.  I am trying to figure out how to convert this to vb.net or vb6 so it can be compiled.

    All the documentation I found is from 2005 visual studio and this doc doesn't work with visual studio 2015 version.  Any help appreciated ,  my module is shown below.

    thx
    mike


    Sub HeaderFilter()

    Dim hdr_row As Long

    With ActiveWorkbook
      If .ProtectWindows Or .ProtectStructure Then
        response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
        End
      End If
    End With
    If Worksheets(ActiveSheet.Name).ProtectContents = True Then
        response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
        End
    End If
    'popup to determine row
        With selected_header
            .Show
            hdr_row = .hdrrow.Value
        End With
        Unload selected_header

        Rows(hdr_row & ":" & hdr_row).Select
        With ActiveWindow
            .SplitColumn = 0
            .SplitRow = 1
        End With
        ActiveWindow.FreezePanes = True
        Selection.AutoFilter
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorAccent1
            .TintAndShade = 0.599993896298105
            .PatternTintAndShade = 0
        End With
        Cells.Select
        Cells.EntireColumn.AutoFit
        Rows(hdr_row & ":" & hdr_row).Select
        Cells.Select
        Selection.AutoFilter
        Selection.AutoFilter
        Range("A1").Select

    End Sub
    Monday, May 7, 2018 9:31 AM

All replies

  • VB6 is just an old version from Visual Basic which is currently in version 15.

    I've asked if your thread can be moved to the visual basic forum. 

    There are persons there who can better help you with your worksheet than me. 


    Success
    Cor

    Monday, May 7, 2018 1:21 PM
  • All the documentation I found is from 2005 visual studio and this doc doesn't work with visual studio 2015 version.

    Documentation of what?

    I think all the members here, especially all Microsoft employees, will strongly recommend converting to VB.Net. Don't attempt to convert to VB 6.

    Are you asking for general advice or specific details? It is unlikely any answer will provide all the details of everything relevant. If you have a specific question about how to convert one specific thing then you are likely to get responses from members eager to help.

    To begin, look for existing articles, such as in a search for convert VBA to vb.net. Read articles such as the following. The second one is archived so you might search for more recent versions.



    Sam Hobbs
    SimpleSamples.Info


    Monday, May 7, 2018 7:13 PM
  • I am new to using Visual Studio and I have a simple VBA module that calls a form that allows the user to select a row that sets a header filter and colors.  I am trying to figure out how to convert this to vb.net or vb6 so it can be compiled.

    All the documentation I found is from 2005 visual studio and this doc doesn't work with visual studio 2015 version.  Any help appreciated ,  my module is shown below.


    It is easy to convert VBA to VB6.  But much more difficult to convert VBA to VB.Net.

    The VBA and VB6 programming languages are almost identical.  VB.Net is completely different.

    But your sample code is obviously related to Excel, what advantage would you see in moving from VBA?


    Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)

    Thursday, May 17, 2018 3:35 PM