Microsoft KB Archive/187583

= XL98: Error with Recorded Macro Using EditionOptions Method =

Article ID: 187583

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q187583



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. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. 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.

