I have an existing Excel file that was created by a former employee (i.e. no longer supported) to create reports and download to user desktops. We have had a request to change the logo at the top of the spreadsheet and have had dificulty doing so. I do not know VBA but would like to know if there is a simple fix to the code that would allow this change. As a temporaty solution, we have just placed the new logo over the top of the old, but since we do not know exactly what the code is doing, we would like to know how to remove the old one completely and link the new one to the code. Here is the code that the error occurs on when the old logo (Icon?) is removed. Error is highlighted in bold red.
Error Message:
Thanks in advance for any help,
Sam
Code:
Private Sub Show(strObj As String, intLen As Integer)
Dim intShapes As Integer
With shtMenu
.Unprotect gkstrPW
Application.ScreenUpdating = False
'hide and show shapes
For intShapes = 1 To .Shapes.Count
If Right(.Shapes(intShapes).Name, intLen) = strObj And Left(.Shapes(intShapes).Name, 3) <> "box" Then
.Shapes(intShapes).Visible = True
ElseIf Left(.Shapes(intShapes).Name, 3) <> "box" And Left(.Shapes(intShapes).Name, 3) <> "frm" Then
.Shapes(intShapes).Visible = False
ElseIf Right(.Shapes(intShapes).Name, intLen) = strObj And Left(.Shapes(intShapes).Name, 3) = "box" Then
.Shapes(intShapes).Fill.ForeColor.RGB = RGB(0, 152, 148)
.Shapes(intShapes).Select
Selection.Characters.Font.ColorIndex = 2
.Cells(1, 1).Select
ElseIf Right(.Shapes(intShapes).Name, intLen) <> strObj And Left(.Shapes(intShapes).Name, 3) = "box" Then
.Shapes(intShapes).Fill.ForeColor.RGB = RGB(229, 205, 228)
.Shapes(intShapes).Select
Selection.Characters.Font.ColorIndex = 14
.Cells(1, 1).Select
End If
Next intShapes
'hide date dropdowns
.Shapes("txbDownload").Visible = False
.Shapes("recDownload").Visible = False
.Shapes("ddbDayDownload").Visible = False
.Shapes("ddbMonthDownload").Visible = False
.Shapes("ddbYearDownload").Visible = False
.Shapes("arwDownload").Visible = False
'make sure everything else is in visible
.Shapes("BtnHelp").Visible = True
[b][COLOR=red] .Shapes("Icon").Visible = True [/color][/b]
.Protect gkstrPW
Application.ScreenUpdating = False
End With
End Sub
Error Message:
Code:
Run-time error '-2147024809 (80070057)':
The item with the specified name wasn't found
Thanks in advance for any help,
Sam