Help and Support

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

Article ID:162721
Last Review:October 11, 2006
Revision:1.2
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 (http://support.microsoft.com/kb/143452/EN-US/) XL97: Excel Hangs When You Programmatically Save a Workbook

143453 (http://support.microsoft.com/kb/143453/EN-US/) XL: Named Arguments Are Not Supported with DAO

143458 (http://support.microsoft.com/kb/143458/EN-US/) XL97: Cannot Move or Copy Sheet After Last Sheet

143460 (http://support.microsoft.com/kb/143460/EN-US/) XL97: Overflow Error Occurs When Using Err Object

143461 (http://support.microsoft.com/kb/143461/EN-US/) XL97: CreateObject and GetObject Work Differently

154873 (http://support.microsoft.com/kb/154873/EN-US/) XL: Error When You Concatenate String and Numeric Values

156879 (http://support.microsoft.com/kb/156879/EN-US/) OFF97: Visual Basic Modules Cannot Be Hidden or Protected

156880 (http://support.microsoft.com/kb/156880/EN-US/) XL97: Using the MenuBars Method in Microsoft Excel 97

157027 (http://support.microsoft.com/kb/157027/EN-US/) XL97: Attached Toolbar Is Not Saved in 5.0/95 File Format

157103 (http://support.microsoft.com/kb/157103/EN-US/) XL97: Macro Stops Running When its Workbook is Closed

157107 (http://support.microsoft.com/kb/157107/EN-US/) XL97: "Type Mismatch" Comparing String Variable to Boolean

157108 (http://support.microsoft.com/kb/157108/EN-US/) XL97: Options not Available in Macro Options Dialog Box

157113 (http://support.microsoft.com/kb/157113/EN-US/) XL97: "Invalid Use of Null" Error Setting OnRepeat Method

157124 (http://support.microsoft.com/kb/157124/EN-US/) XL97: Styles("X").Parent Different Than in Earlier Versions of Excel

157203 (http://support.microsoft.com/kb/157203/EN-US/) XL97: Cannot Add Macros to the Tools Menu

157308 (http://support.microsoft.com/kb/157308/EN-US/) XL97: Calling RunAutoMacros Method More than Once Fails
157351 (http://support.microsoft.com/kb/157351/EN-US/) XL97: Compile Error Passing ParamArray

157412 (http://support.microsoft.com/kb/157412/EN-US/) XL97: Select Method May Select More Cells Than Expected

157436 (http://support.microsoft.com/kb/157436/EN-US/) XL97: DAO 3.0 CopyFromRecordSet Method Not Compatible with Excel 97

157471 (http://support.microsoft.com/kb/157471/EN-US/) XL97: Run-Time Error Using CreateObject With DAO.DBEngine

157553 (http://support.microsoft.com/kb/157553/EN-US/) OFF97: Dialog Boxes and UserForms Use Tahoma Font

157754 (http://support.microsoft.com/kb/157754/EN-US/) XL97: Problems When Disabling/Enabling Menus

157755 (http://support.microsoft.com/kb/157755/EN-US/) XL97: Using "Checked", "Gray", and "Unchecked" in Macros

158066 (http://support.microsoft.com/kb/158066/EN-US/) XL97: Reference to DAO 3.0 Changes to DAO 3.5 When File Opened

158072 (http://support.microsoft.com/kb/158072/EN-US/) XL97: Menu Added in Wrong Position on Menu Bar

158080 (http://support.microsoft.com/kb/158080/EN-US/) XL97: Cannot Paste Array Formula in its Original Cell

158222 (http://support.microsoft.com/kb/158222/EN-US/) XL97: ParamArrays are Always Zero-Based

158353 (http://support.microsoft.com/kb/158353/EN-US/) XL97: Error When Invalid Characters in Drawing Object Name

158355 (http://support.microsoft.com/kb/158355/EN-US/) XL97: ParamArray Must be Declared as an Array of Variant

158360 (http://support.microsoft.com/kb/158360/EN-US/) XL97: PasteSpecial Method Activates Target Sheet

158434 (http://support.microsoft.com/kb/158434/EN-US/) XL97: Cannot Make Changes to Some Shortcut Menus

158472 (http://support.microsoft.com/kb/158472/EN-US/) XL97: No Automatic Type Coercion Between Variable Types

158550 (http://support.microsoft.com/kb/158550/EN-US/) XL97: Problems Disabling and Enabling Shortcut Menus

158632 (http://support.microsoft.com/kb/158632/EN-US/) XL97: Limitations for Naming Visual Basic Modules

158638 (http://support.microsoft.com/kb/158638/EN-US/) XL97: ApplyNames Method May Cause Invalid Page Fault

158711 (http://support.microsoft.com/kb/158711/EN-US/) XL97: Cannot Edit Text Box with Unlocked Text

158746 (http://support.microsoft.com/kb/158746/EN-US/) XL97: Error When Passing an Array Value Between Macros

158801 (http://support.microsoft.com/kb/158801/EN-US/) XL97: Text is Truncated in a Text Box with Rounded Corners

158895 (http://support.microsoft.com/kb/158895/EN-US/) XL97: Invalid Page Fault After Closing Last Open Workbook

158905 (http://support.microsoft.com/kb/158905/EN-US/) XL97: "Bad DLL Calling Convention" When Running a Macro

158997 (http://support.microsoft.com/kb/158997/EN-US/) XL97: Error When Variable Refers to Deleted or Moved Sheet

159465 (http://support.microsoft.com/kb/159465/EN-US/) XL97: "Module not Found" Error Opening Workbook

159622 (http://support.microsoft.com/kb/159622/EN-US/) XL97: Cannot Change Value for Form Control on Worksheet

159794 (http://support.microsoft.com/kb/159794/EN-US/) XL97: Cannot Programmatically Close Referenced Workbook

159845 (http://support.microsoft.com/kb/159845/EN-US/) XL97: Parentheses Around Object May Dereference the Object

159861 (http://support.microsoft.com/kb/159861/EN-US/) XL97: Setting Window Caption Changes Caption for Active Window

159877 (http://support.microsoft.com/kb/159877/EN-US/) XL97: Crash Saving Workbook If Module Name Contains Equal Sign

159914 (http://support.microsoft.com/kb/159914/EN-US/) XL97: Bitmap Image Shrinks When Pasted on a Toolbar Button

159915 (http://support.microsoft.com/kb/159915/EN-US/) XL97: How to Delete Cells with a For Each...Next Loop

159922 (http://support.microsoft.com/kb/159922/EN-US/) XL97: Using Quit Method May Cause Illegal Operation

159938 (http://support.microsoft.com/kb/159938/EN-US/) XL97: Structure and Windows Arguments of Protect Method

159944 (http://support.microsoft.com/kb/159944/EN-US/) XL97: Range.PasteSpecial Changes Selection

159947 (http://support.microsoft.com/kb/159947/EN-US/) XL97: Illegal Operation Unhiding a Row with a Macro

159958 (http://support.microsoft.com/kb/159958/EN-US/) XL97: Unexpected Results Paste Linking Noncontiguous Range

159960 (http://support.microsoft.com/kb/159960/EN-US/) XL: Drawing Objects Behave Differently when Clicked

159964 (http://support.microsoft.com/kb/159964/EN-US/) XL97: Pointer is an Hourglass When You Display a Message Box

159966 (http://support.microsoft.com/kb/159966/EN-US/) XL97: Redraw Problem Changing Visibility of Object on Dialog Box

160032 (http://support.microsoft.com/kb/160032/EN-US/) XL97: Invalid Page Fault Saving a Workbook or Add-In

160058 (http://support.microsoft.com/kb/160058/EN-US/) XL97: Error Changing Order of Option Buttons on a Dialog Sheet

160085 (http://support.microsoft.com/kb/160085/EN-US/) XL97: Page Fault Accessing Demand-Loaded Add-in

160462 (http://support.microsoft.com/kb/160462/EN-US/) XL97: Auto_Close Macros Run When You Use Application.Quit

160520 (http://support.microsoft.com/kb/160520/EN-US/) XL97: Error Adding or Deleting a Menu Command in a Macro

163718 (http://support.microsoft.com/kb/163718/EN-US/) XL97: Page Setup Command Does Not Exist in Modules

164500 (http://support.microsoft.com/kb/164500/EN-US/) XL97: Help Argument for MsgBox Function Behaves Differently

164810 (http://support.microsoft.com/kb/164810/EN-US/) XL97: Run-Time Error Using ShowDependents Method

165103 (http://support.microsoft.com/kb/165103/EN-US/) XL97: Value Returned by VarType for Omitted Arguments Differs

165866 (http://support.microsoft.com/kb/165866/EN-US/) XL: How to Use File DSNs and DSN-less Connections

166101 (http://support.microsoft.com/kb/166101/EN-US/) XL97: Visible Property Does Not Apply to All CommandBars

167178 (http://support.microsoft.com/kb/167178/EN-US/) XL97: Some Properties and Methods Are Missing in Object Browser

168364 (http://support.microsoft.com/kb/168364/EN-US/) XL97: Charts.Delete Command in Macro May Delete Worksheets

168436 (http://support.microsoft.com/kb/168436/EN-US/) XL97: Can't Tile Windows with Macro If a Window Is Minimized

168754 (http://support.microsoft.com/kb/168754/EN-US/) XL97: Error Applying Comment When Worksheets Are Grouped

167277 (http://support.microsoft.com/kb/167277/EN-US/) XL97: Referenced Workbooks and Add-Ins Are Automatically Opened

APPLIES TO
Microsoft Excel 97 Standard Edition

Back to the top

Keywords: 
kbdtacode kbfaq kbhowto kbprb kbprogramming KB162721

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.