#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"