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

ID: Q162721


The information in this article applies to:



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:

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.

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.


   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q143452">Q143452</LINK> 

   TITLE     : XL97: Excel Hangs When You Programmatically Save a 
Workbook



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q143453">Q143453</LINK> 

   TITLE     : XL: Named Arguments Are Not Supported with DAO 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q143458">Q143458</LINK> 

   TITLE     : XL97: Cannot Move or Copy Sheet After Last Sheet 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q143460">Q143460</LINK> 

   TITLE     : XL97: Overflow Error Occurs When Using Err Object 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q143461">Q143461</LINK> 

   TITLE     : XL97: CreateObject and GetObject Work Differently 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q154873">Q154873</LINK> 

   TITLE     : XL: Error When You Concatenate String and Numeric Values 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q156879">Q156879</LINK> 

   TITLE     : OFF97: Visual Basic Modules Cannot Be Hidden or Protected 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q156880">Q156880</LINK> 

   TITLE     : XL97: Using the MenuBars Method in Microsoft Excel 97 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157027">Q157027</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157103">Q157103</LINK> 

   TITLE     : XL97: Macro Stops Running When its Workbook is Closed 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157107">Q157107</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157108">Q157108</LINK> 

   TITLE     : XL97: Options not Available in Macro Options Dialog Box 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157113">Q157113</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157124">Q157124</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157203">Q157203</LINK> 

   TITLE     : XL97: Cannot Add Macros to the Tools Menu 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157308">Q157308</LINK> 

   TITLE     : XL97: Calling RunAutoMacros Method More than Once Fails 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157351">Q157351</LINK> 

   TITLE     : XL97: Compile Error Passing ParamArray 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157412">Q157412</LINK> 

   TITLE     : XL97: Select Method May Select More Cells Than Expected 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157436">Q157436</LINK> 

   TITLE     : XL97: DAO 3.0 CopyFromRecordSet Method Not Compatible With XL97 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157471">Q157471</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157553">Q157553</LINK> 

   TITLE     : XL97: Dialog Boxes and UserForms Use Tahoma Font 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157754">Q157754</LINK> 

   TITLE     : XL97: Problems When Disabling/Enabling Menus 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q157755">Q157755</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158066">Q158066</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158072">Q158072</LINK> 

   TITLE     : XL97: Menu Added in Wrong Position on Menu Bar 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158080">Q158080</LINK> 

   TITLE     : XL97: Cannot Paste Array Formula in its Original Cell 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158222">Q158222</LINK> 

   TITLE     : XL97: ParamArrays are Always Zero-Based 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158353">Q158353</LINK> 

   TITLE     : XL97: Error When Invalid Characters in Drawing Object 
Name



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158355">Q158355</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158360">Q158360</LINK> 

   TITLE     : XL97: PasteSpecial Method Activates Target Sheet 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158434">Q158434</LINK> 

   TITLE     : XL97: Cannot Make Changes to Some Shortcut Menus 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158472">Q158472</LINK> 

   TITLE     : XL97: No Automatic Type Coercion Between Variable Types 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158550">Q158550</LINK> 

   TITLE     : XL97: Problems Disabling and Enabling Shortcut Menus 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158632">Q158632</LINK> 

   TITLE     : XL97: Limitations for Naming Visual Basic Modules 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158638">Q158638</LINK> 

   TITLE     : XL97: ApplyNames Method May Cause Invalid Page Fault 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158711">Q158711</LINK> 

   TITLE     : XL97: Cannot Edit Text Box with Unlocked Text 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158746">Q158746</LINK> 

   TITLE     : XL97: Error When Passing an Array Value Between Macros 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158801">Q158801</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158895">Q158895</LINK> 

   TITLE     : XL97: Invalid Page Fault After Closing Last Open Workbook 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158905">Q158905</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q158997">Q158997</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159465">Q159465</LINK> 

   TITLE     : XL97: "Module not Found" Error Opening Workbook 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159622">Q159622</LINK> 

   TITLE     : XL97: Cannot Change Value for Form Control on Worksheet 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159794">Q159794</LINK> 

   TITLE     : XL97: Cannot Programmatically Close Referenced Workbook 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159845">Q159845</LINK> 

   TITLE     : XL97: Parentheses Around Object May Dereference the 
Object



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159861">Q159861</LINK> 

   TITLE     : XL97: Setting Window Caption Changes Caption for Active 
Window



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159877">Q159877</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159914">Q159914</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159915">Q159915</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159922">Q159922</LINK> 

   TITLE     : XL97: Using Quit Method May Cause Illegal Operation 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159938">Q159938</LINK> 

   TITLE     : XL97: Structure and Windows Arguments of Protect Method 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159944">Q159944</LINK> 

   TITLE     : XL97: Range.PasteSpecial Changes Selection 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159947">Q159947</LINK> 

   TITLE     : XL97: Illegal Operation Unhiding a Row with a Macro 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159949">Q159949</LINK> 

   TITLE     : XL97: Input # Statement Does Not Retain Trailing Spaces 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159957">Q159957</LINK> 

   TITLE     : XL97: Run-time Error '1004' Accessing Locally Defined 
Name



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159958">Q159958</LINK> 

   TITLE     : XL97: Unexpected Results Paste Linking Noncontiguous 
Range



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159960">Q159960</LINK> 

   TITLE     : XL: Drawing Objects Behave Differently when Clicked 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159964">Q159964</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q159966">Q159966</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q160032">Q160032</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q160058">Q160058</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q160085">Q160085</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q160462">Q160462</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q160520">Q160520</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q163718">Q163718</LINK> 

   TITLE     : XL97: Page Setup Command Does Not Exist in Modules 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q164500">Q164500</LINK> 

   TITLE     : XL97: Help Argument for MsgBox Function Behaves 
Differently



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q164810">Q164810</LINK> 

   TITLE     : XL97: Run-Time Error Using ShowDependents Method 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q165103">Q165103</LINK> 

   TITLE     : XL97: Value Returned by VarType for Omitted Arguments 
Differs



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q165866">Q165866</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q166101">Q166101</LINK> 

   TITLE     : XL97: Visible Property Does Not Apply to All CommandBars 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q167178">Q167178</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q168364">Q168364</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q168436">Q168436</LINK> 

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



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q168754">Q168754</LINK> 

   TITLE     : XL97: Error Applying Comment When Worksheets Are Grouped 



   ARTICLE-ID: <LINK TYPE="ARTICLE" VALUE="Q167277">Q167277</LINK> 

   TITLE     : 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 KbVBA kbprb 
Version           : WINDOWS:97
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: June 30, 1999