XL98: Error with Recorded Macro Using EditionOptions Method

ID: Q187583


The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition


SYMPTOMS

If you record a macro that uses the EditionOptions method, the macro may not run when you play it back. When you run the recorded macro, you may receive the following error message:

Run-time error '438':
Object doesn't support this property or method
NOTE: You may also receive this error message if you run a macro that you created in Microsoft Excel for the Macintosh version 5.0 in Excel 98 Macintosh Edition.


CAUSE

You receive this error message when you run your recorded macro because the macro recorder in Microsoft Excel 98 Macintosh Edition incorrectly uses the ActiveWorkbook object instead of the Range object with the EditionOptions method.

NOTE: You receive the error if you run a macro that you created in Excel for the Macintosh 5.0 because the object model in Excel 98 has changed. The EditionOptions method in Excel 5.0 applies to the Workbook object, but in Excel 98, it applies to the Range object.


RESOLUTION

In order for your macro to run without error in Excel 98, change the line(s) of code that use the EditionOptions method so that they use the Range object instead of the Workbook object. See the "More Information" section of this article for more details.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel 98 Macintosh Edition.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
When you record a macro in Excel 98 where you change the Update type for a Publisher from Automatic to Manual, you may get code similar to the following:

   Sub Macro1()

      ActiveWorkbook.EditionOptions Type:=1, _
         Name:="Workbook1 Edition #1", Reference:="Sheet1!Chart1", _
         Option:=5

   End Sub 
When you rerun this recorded macro, you will receive the error mentioned in the "Symptoms" section. To make this macro run successfully, change it as follows:

   Sub Macro1()

      Sheet1.Range("a1").EditionOptions Type:=1, _
         Name:="Workbook1 Edition #1", Reference:="Sheet1!Chart1", _
         Option:=5

   End Sub 
NOTE: The only change to the code is that ActiveWorkbook was replaced with a valid Range object reference, Sheet1.Range("a1") in this example.


REFERENCES

For more information about the EditionOptions method, from the Visual Basic Editor, click the Office Assistant, type editionoptions, click Search, and then click to view "EditionOptions Method."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

Q176476 OFF: Office Assistant Not Answering Visual Basic Questions

Additional query words: XL98

Keywords : kberrmsg kbdta xlvbainfo xlvbmigrate
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbbug


Last Reviewed: February 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.