ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2008-2003 incompatibility (https://www.excelbanter.com/excel-programming/404682-2008-2003-incompatibility.html)

[email protected]

2008-2003 incompatibility
 
I have multiple workbooks that have the following code:{some clean up
done so it may not be perfect}
Dim theRect As Shape
Dim curSheet As Worksheet
Set curSheet = ActiveSheet
Application.ScreenUpdating = False
For Each theRect In ActiveSheet.Shapes
If (theRect.Line.ForeColor.SchemeColor = 12) Then
theRect.Line.ForeColor.SchemeColor = 9
End If
Next


When that code runs on XP/Office 2003 in a workbook that has been
saved on Vista/Office 2008, I get runtime error 70, Permission denied
when trying to access the schemecolor in the if statement. This code
has been in the workbooks for quite a few years, but they have been
recently updated(in other areas) to work correctly on Vista/Office
2008.

Weird thing is that if I debug and skip the execution of the if
statement, I can modify the schemecolor, and then can access the
schemecolor of that rect with out issue.

Has anyone else seen this?


All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com