ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   97 and xp (https://www.excelbanter.com/excel-programming/277848-97-xp.html)

Wes[_4_]

97 and xp
 
I've run into a problem again where a program works fine
on xp and 2000, but not on 97. My program has 2 bugs,
here is the code that give the problems

1. This code is run after a dropdown list changes
With Worksheets("Report").Range("ai5").Characters
(Start:=7, Length:=1).Font
.Name = "Wingdings"
.FontStyle = "Regular"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Error: Unable to set the Name Property of Font Class

2. This is another part of code run after the dropdown
list is changed.

With Worksheets("Report")
.Unprotect Pword
(Some Code)
Worksheets("Report").Protect password:=Pword
End With

Error: Unprotect method of worksheet class failed

Wes[_4_]

97 and xp
 
Got it figured out on my own, Thanks.


-----Original Message-----
I've run into a problem again where a program works fine
on xp and 2000, but not on 97. My program has 2 bugs,
here is the code that give the problems

1. This code is run after a dropdown list changes
With Worksheets("Report").Range("ai5").Characters
(Start:=7, Length:=1).Font
.Name = "Wingdings"
.FontStyle = "Regular"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Error: Unable to set the Name Property of Font Class

2. This is another part of code run after the dropdown
list is changed.

With Worksheets("Report")
.Unprotect Pword
(Some Code)
Worksheets("Report").Protect password:=Pword
End With

Error: Unprotect method of worksheet class failed
.


Tom Ogilvy

97 and xp
 
sounds like you are running this from a commandbutton. If so, manually
change the takefocusonclick property of the commandbutton to false.

--
Regards,
Tom Ogilvy

"Wes" wrote in message
...
I've run into a problem again where a program works fine
on xp and 2000, but not on 97. My program has 2 bugs,
here is the code that give the problems

1. This code is run after a dropdown list changes
With Worksheets("Report").Range("ai5").Characters
(Start:=7, Length:=1).Font
.Name = "Wingdings"
.FontStyle = "Regular"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Error: Unable to set the Name Property of Font Class

2. This is another part of code run after the dropdown
list is changed.

With Worksheets("Report")
.Unprotect Pword
(Some Code)
Worksheets("Report").Protect password:=Pword
End With

Error: Unprotect method of worksheet class failed





All times are GMT +1. The time now is 11:45 AM.

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