HardAtWork
Board Regular
- Joined
- Sep 17, 2010
- Messages
- 52
I have been working on a large code that changes the color in the interior of the cells, font and shapes within a file.
I will include only a portion of the code (due to the length), but my problem is that it works fine on Excel 2007 and 2010 but not in 2003. The file itself works, but not when I try to make the code changes via a push button.
Background. I started and completed the coding using XP with Excel 2007 (Not Sure if that would matter or not).
I get an error code with the code I will provide stating that it can't set the interior code. I put ** in the code were its highlights in VBA.
The file works fine on all versions without my new codes, and works fine in 2007 and 2010 with the new code.
Can ya'll assist me in finding out maybe why this code will not work in 2003?
If you would like to see the entire coding let me know and I can add it.
Here the portion of the coding I have done
Private Sub Night_Mode_Click()
If Application.Version = "11.0" Or_
Application.Version = "12.0" Or _
Application.Version = "14.0" Then
ActiveWorkbook.Unprotect "Password"
Application.ScreenUpdating = False
Worksheets("Not Compatible").Visible = True
Worksheets("Not Compatible").Select
Worksheets("Not Compatible").Unprotect "Password"
Worksheets("Not Compatible").Range("A1:T70").Interior.ColorIndex = 56 **
Worksheets("Not Compatible").Range("A1:T70").Font.ColorIndex = 4
Worksheets("Not Compatible").Shapes("Text Box 1").Select
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Shapes("TextBox 4").Select 'no space
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Shapes("TextBox 6").Select 'no space
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Unprotect "Passoword"
Worksheets("Not Compatible").Visible = False 'I want this page to hide, but the changes to be made
Worksheets("Not Compatible").Select
ActiveWorkbook.Protect "Password"
Application.ScreenUpdating = True
End Sub
Basically, this code gets repeated numerous times for the different tabs.
Thank you ahead of time for any assistance in this matter. This issue is the only thing that is holding me up from releasing this file for use.
I will include only a portion of the code (due to the length), but my problem is that it works fine on Excel 2007 and 2010 but not in 2003. The file itself works, but not when I try to make the code changes via a push button.
Background. I started and completed the coding using XP with Excel 2007 (Not Sure if that would matter or not).
I get an error code with the code I will provide stating that it can't set the interior code. I put ** in the code were its highlights in VBA.
The file works fine on all versions without my new codes, and works fine in 2007 and 2010 with the new code.
Can ya'll assist me in finding out maybe why this code will not work in 2003?
If you would like to see the entire coding let me know and I can add it.
Here the portion of the coding I have done
Private Sub Night_Mode_Click()
If Application.Version = "11.0" Or_
Application.Version = "12.0" Or _
Application.Version = "14.0" Then
ActiveWorkbook.Unprotect "Password"
Application.ScreenUpdating = False
Worksheets("Not Compatible").Visible = True
Worksheets("Not Compatible").Select
Worksheets("Not Compatible").Unprotect "Password"
Worksheets("Not Compatible").Range("A1:T70").Interior.ColorIndex = 56 **
Worksheets("Not Compatible").Range("A1:T70").Font.ColorIndex = 4
Worksheets("Not Compatible").Shapes("Text Box 1").Select
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Shapes("TextBox 4").Select 'no space
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Shapes("TextBox 6").Select 'no space
With Selection.Font
.ColorIndex = 4
End With
Worksheets("Not Compatible").Unprotect "Passoword"
Worksheets("Not Compatible").Visible = False 'I want this page to hide, but the changes to be made
Worksheets("Not Compatible").Select
ActiveWorkbook.Protect "Password"
Application.ScreenUpdating = True
End Sub
Basically, this code gets repeated numerous times for the different tabs.
Thank you ahead of time for any assistance in this matter. This issue is the only thing that is holding me up from releasing this file for use.