Microsoft KB Archive/162721

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

Article ID: 162721

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q162721





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.

143452 XL97: Excel Hangs When You Programmatically Save a Workbook

143453 XL: Named Arguments Are Not Supported with DAO

143458 XL97: Cannot Move or Copy Sheet After Last Sheet

143460 XL97: Overflow Error Occurs When Using Err Object

143461 XL97: CreateObject and GetObject Work Differently

154873 XL: Error When You Concatenate String and Numeric Values

156879 OFF97: Visual Basic Modules Cannot Be Hidden or Protected

156880 XL97: Using the MenuBars Method in Microsoft Excel 97

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

157103 XL97: Macro Stops Running When its Workbook is Closed

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

157108 XL97: Options not Available in Macro Options Dialog Box

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

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

157203 XL97: Cannot Add Macros to the Tools Menu

157308 XL97: Calling RunAutoMacros Method More than Once Fails

157351 XL97: Compile Error Passing ParamArray

157412 XL97: Select Method May Select More Cells Than Expected

157436 XL97: DAO 3.0 CopyFromRecordSet Method Not Compatible with Excel 97

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

157553 OFF97: Dialog Boxes and UserForms Use Tahoma Font

157754 XL97: Problems When Disabling/Enabling Menus

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

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

158072 XL97: Menu Added in Wrong Position on Menu Bar

158080 XL97: Cannot Paste Array Formula in its Original Cell

158222 XL97: ParamArrays are Always Zero-Based

158353 XL97: Error When Invalid Characters in Drawing Object Name

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

158360 XL97: PasteSpecial Method Activates Target Sheet

158434 XL97: Cannot Make Changes to Some Shortcut Menus

158472 XL97: No Automatic Type Coercion Between Variable Types

158550 XL97: Problems Disabling and Enabling Shortcut Menus

158632 XL97: Limitations for Naming Visual Basic Modules

158638 XL97: ApplyNames Method May Cause Invalid Page Fault

158711 XL97: Cannot Edit Text Box with Unlocked Text

158746 XL97: Error When Passing an Array Value Between Macros

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

158895 XL97: Invalid Page Fault After Closing Last Open Workbook

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

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

159465 XL97: "Module not Found" Error Opening Workbook

159622 XL97: Cannot Change Value for Form Control on Worksheet

159794 XL97: Cannot Programmatically Close Referenced Workbook

159845 XL97: Parentheses Around Object May Dereference the Object

159861 XL97: Setting Window Caption Changes Caption for Active Window

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

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

159915 XL97: How to Delete Cells with a For Each...Next Loop

159922 XL97: Using Quit Method May Cause Illegal Operation

159938 XL97: Structure and Windows Arguments of Protect Method

159944 XL97: Range.PasteSpecial Changes Selection

159947 XL97: Illegal Operation Unhiding a Row with a Macro

159958 XL97: Unexpected Results Paste Linking Noncontiguous Range

159960 XL: Drawing Objects Behave Differently when Clicked

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

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

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

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

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

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

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

163718 XL97: Page Setup Command Does Not Exist in Modules

164500 XL97: Help Argument for MsgBox Function Behaves Differently

164810 XL97: Run-Time Error Using ShowDependents Method

165103 XL97: Value Returned by VarType for Omitted Arguments Differs

165866 XL: How to Use File DSNs and DSN-less Connections

166101 XL97: Visible Property Does Not Apply to All CommandBars

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

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

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

168754 XL97: Error Applying Comment When Worksheets Are Grouped

167277 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: kbdtacode kbfaq kbhowto kbprb kbprogramming KB162721

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.