XL97: VBA Macro Behavior Is Different from Excel 5.0 or 7.0

ID: Q162721


The information in this article applies to:
  • Microsoft Excel 97 for Windows


SUMMARY

When you run a Visual Basic for Applications macro in Microsoft Excel 97, the way the macro behaves may be different from the way it behaves in earlier versions of Microsoft Excel. This may be true for any of the following reasons:

  • The architecture of Microsoft Excel 97 is somewhat different from the architecture that is used in earlier versions of Microsoft Excel. Some elements (for example, menu bars and toolbars) are greatly enhanced in Microsoft Excel 97. As a result, Visual Basic code that interacts with these elements may work differently.


  • Microsoft Excel 97 corrects some problems that are present in earlier versions of Microsoft Excel. As a result, Visual Basic code that works in earlier versions of Microsoft Excel may work differently in Microsoft Excel 97.


  • Because all of the Microsoft Office programs include Microsoft Visual Basic for Applications, the Visual Basic environment in Microsoft Excel includes changes that accommodate the new programs and provide consistent behavior in all programs. As a result, code that uses OLE Automation or other cross-product functionality may work differently in Microsoft Excel 97.


Microsoft realizes the importance of minimizing the amount of effort that is required to use macros in Microsoft Excel 97. Microsoft Excel 97 is designed to be compatible with earlier versions of Microsoft Excel; however, in some cases, it may be necessary to modify your code so that it works in Microsoft Excel 97.


MORE INFORMATION

Modifying your code so that it works with Microsoft Excel 97 usually requires making only a few minor changes. The following is a list of articles in the Microsoft Knowledge Base that address compatibility issues in Microsoft Excel 97. Wherever possible, the articles contain the information you need to modify Visual Basic macros so that they function in both Microsoft Excel 97 and in earlier versions of Microsoft Excel.

Q143452 XL97: Excel Hangs When You Programmatically Save a Workbook

Q143453 XL: Named Arguments Are Not Supported with DAO

Q143458 XL97: Cannot Move or Copy Sheet After Last Sheet

Q143460 XL97: Overflow Error Occurs When Using Err Object

Q143461 XL97: CreateObject and GetObject Work Differently

Q154873 XL: Error When You Concatenate String and Numeric Values

Q156879 OFF97: Visual Basic Modules Cannot Be Hidden or Protected

Q156880 XL97: Using the MenuBars Method in Microsoft Excel 97

Q157027 XL97: Attached Toolbar Is Not Saved in 5.0/95 File Format

Q157103 XL97: Macro Stops Running When its Workbook is Closed

Q157107 XL97: "Type Mismatch" Comparing String Variable to Boolean

Q157108 XL97: Options not Available in Macro Options Dialog Box

Q157113 XL97: "Invalid Use of Null" Error Setting OnRepeat Method

Q157124 XL97: Styles("X").Parent Different Than in Earlier Versions of Excel

Q157203 XL97: Cannot Add Macros to the Tools Menu

Q157308 XL97: Calling RunAutoMacros Method More than Once Fails
Q157351 XL97: Compile Error Passing ParamArray

Q157412 XL97: Select Method May Select More Cells Than Expected

Q157436 XL97: DAO 3.0 CopyFromRecordSet Method Not Compatible With XL97

Q157471 XL97: Run-Time Error Using CreateObject With DAO.DBEngine

Q157553 XL97: Dialog Boxes and UserForms Use Tahoma Font

Q157754 XL97: Problems When Disabling/Enabling Menus

Q157755 XL97: Using "Checked", "Gray", and "Unchecked" in Macros

Q158066 XL97: Reference to DAO 3.0 Changes to DAO 3.5 When File Opened

Q158072 XL97: Menu Added in Wrong Position on Menu Bar

Q158080 XL97: Cannot Paste Array Formula in its Original Cell

Q158222 XL97: ParamArrays are Always Zero-Based

Q158353 XL97: Error When Invalid Characters in Drawing Object Name

Q158355 XL97: ParamArray Must be Declared as an Array of Variant

Q158360 XL97: PasteSpecial Method Activates Target Sheet

Q158434 XL97: Cannot Make Changes to Some Shortcut Menus

Q158472 XL97: No Automatic Type Coercion Between Variable Types

Q158550 XL97: Problems Disabling and Enabling Shortcut Menus

Q158632 XL97: Limitations for Naming Visual Basic Modules

Q158638 XL97: ApplyNames Method May Cause Invalid Page Fault

Q158711 XL97: Cannot Edit Text Box with Unlocked Text

Q158746 XL97: Error When Passing an Array Value Between Macros

Q158801 XL97: Text is Truncated in a Text Box with Rounded Corners

Q158895 XL97: Invalid Page Fault After Closing Last Open Workbook

Q158905 XL97: "Bad DLL Calling Convention" When Running a Macro

Q158997 XL97: Error When Variable Refers to Deleted or Moved Sheet

Q159465 XL97: "Module not Found" Error Opening Workbook

Q159622 XL97: Cannot Change Value for Form Control on Worksheet

Q159794 XL97: Cannot Programmatically Close Referenced Workbook

Q159845 XL97: Parentheses Around Object May Dereference the Object

Q159861 XL97: Setting Window Caption Changes Caption for Active Window

Q159877 XL97: Crash Saving Workbook If Module Name Contains Equal Sign

Q159914 XL97: Bitmap Image Shrinks When Pasted on a Toolbar Button

Q159915 XL97: Deleting Cells with a For Each...Next Loop

Q159922 XL97: Using Quit Method May Cause Illegal Operation

Q159938 XL97: Structure and Windows Arguments of Protect Method

Q159944 XL97: Range.PasteSpecial Changes Selection

Q159947 XL97: Illegal Operation Unhiding a Row with a Macro

Q159949 XL97: Input # Statement Does Not Retain Trailing Spaces

Q159958 XL97: Unexpected Results Paste Linking Noncontiguous Range

Q159960 XL: Drawing Objects Behave Differently when Clicked

Q159964 XL97: Pointer is an Hourglass When You Display a Message Box

Q159966 XL97: Redraw Problem Changing Visibility of Object on Dialog Box

Q160032 XL97: Invalid Page Fault Saving a Workbook or Add-In

Q160058 XL97: Error Changing Order of Option Buttons on a Dialog Sheet

Q160085 XL97: Page Fault Accessing Demand-Loaded Add-in

Q160462 XL97: Auto_Close Macros Run When You Use Application.Quit

Q160520 XL97: Error Adding or Deleting a Menu Command in a Macro

Q163718 XL97: Page Setup Command Does Not Exist in Modules

Q164500 XL97: Help Argument for MsgBox Function Behaves Differently

Q164810 XL97: Run-Time Error Using ShowDependents Method

Q165103 XL97: Value Returned by VarType for Omitted Arguments Differs

Q165866 XL97: How to Use File DSNs and DSN-less Connections

Q166101 XL97: Visible Property Does Not Apply to All CommandBars

Q167178 XL97: Some Properties and Methods Are Missing in Object Browser

Q168364 XL97: Charts.Delete Command in Macro May Delete Worksheets

Q168436 XL97: Can't Tile Windows with Macro If a Window Is Minimized

Q168754 XL97: Error Applying Comment When Worksheets Are Grouped

Q167277 XL97: Referenced Workbooks and Add-Ins Are Automatically Opened

Additional query words: XL97 macro subroutine code fail error halt message convert conversion vba xlvbmigrate

Keywords : kbprg kbdta kbdtacode OffVBA KbVBA kbprb
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: August 12, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.