What are the differences between VBA 6.0 and VBA 7.0?

后端 未结 4 834
夕颜
夕颜 2020-11-28 23:32

I noticed that Office 2010 comes with Visual Basic for Applications 7.0. However I can\'t seem to find much documentation on what changes were made. Does anyone have a summa

4条回答
  •  日久生厌
    2020-11-29 00:34

    There are other changes as well... I'm having users in the field report that code which functioned properly in 2007 no longer works and shows errors.

    Example, this works in VBA6 (Excel 2007)

    PRINT STRING$(80,"=")
    mynewdata = MID$(mydata, 15,4)
    

    It prints out a line made of "=" characters as a visual break, then looks at mydata, jumps over 15 characters and gets 4 of them, the result is stored in mynewdata. It fails in VBA7 (Excel 2010).

    I did find a potential workaround...

    PRINT VBA.STRING$(80,"=")
    mynewdata = VBA.MID$(mydata, 15,4)
    

    OR

    PRINT VBA.STRING(80,"=")
    mynewdata = VBA.MID(mydata, 15,4)
    

    A complete list of changes would still be helpful... and/or a file converter.

提交回复
热议问题