Coffeehouse Post

Single Post Permalink

View Thread: when will the excel VBA programming model be replaced?
  • User profile image
    SteveRichter

    I will check on VSTO again. I am looking to put a combobox in a cell that is populated with season codes from a database. Select a season code and the combobox and the cell to the right is populated with styles for the season. Which cascades to a combobox with the colors of the style.  

    Was going to use the .Validation property of a cell to do this, but the validation list is limited to some limitation that likely dates back to 1992.

    Does VSTO replace VBA?   Can I double click a cell in the spreadsheet and run .NET code that pops up a WPF form and then populates a row in the spreadsheet from the .NET code?  I can attach the VSTO project to an excel spreadsheet just like VBA code?  The VSTO code will run on Excel 2007?

    I have isolated what is crashing excel 2010 on me.  When the button click handler assigns a value to the active cell, excel crashes. Run the code with that single assignment statement commented out, and it runs ok.

    -- worksheet double click handler news up a VBA form:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    Dim fm2 As frmDummy
    Set fm2 = New frmDummy
    fm2.Show
    Set fm2 = Nothing

    End Sub

    -- ok button click handler assigns a value to the active cell. excel 2010 crashes.

    Private Sub butOk_Click()
    Worksheets("Sheet1").Activate
    Set r1 = ActiveCell.Offset(0, 0)
    r1.Value = "abc"    ' <== comment this out. excel does not crash.
    Set r1 = Nothing
    Unload Me
    End Sub