LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro does not work after the program has been restarted in excel.Run time error 2147417848 (80010108) Method visible of object_worksheet failed

I have a serious problem which i can not solve. I have buildt a simple
password login macro in excel making it possible to give different
users different information.

The macro works fine when I made it, however After I save it and
restart it again the above message pops up, when I start the Macro.

the macro I have made look like this,
I seems like the macro crash on this line ( Sheets(i).Visible =
xlSheetVeryHidden)

Private Sub showAll()
Dim i As Integer
For i = 2 To Sheets.Count
Sheets(i).Visible = xlSheetVisible
Next i
End Sub

Private Sub CommandButton1_Click()
Dim vPasswords As Variant
Dim result As String
Dim i, x As Integer
Dim arrLength As Integer


x = 0



vPasswords = Array("OSLO", "Northern Europe", "FERRARI", "Southern
Europe", "HEINEKEN", "Central Europe")
arrLength = UBound(vPasswords) - 1


For i = 2 To Sheets.Count
Sheets(i).Visible = xlSheetVeryHidden
Next i

result = Application.InputBox(prompt:="Enter password", Type:=2,
Title:="Port Report 2005")

If result = "system" Then
For i = 2 To Sheets.Count
Sheets(i).Visible = xlSheetVisible
Next i
Else

Do
If result = "False" Then Exit Sub

For i = LBound(vPasswords) To UBound(vPasswords) Step 2
If vPasswords(i) = result Then
With Sheets(vPasswords(i + 1))
.Visible = True
.Activate
x = x + 1
End With

End If

If i = arrLength Then Exit Do

Next i

Loop While True
If x = 0 Then
MsgBox "You entered wrong password, please try
again, If you miss your password pls contact Knut Espegren"
'Else
'Sheets(2).Visible = xlSheetVisible
End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub


I apprecatie any help with this one as it is driving me crazy!

Thank you in advance

Brgds

Knut

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation error '-2147417848 (80010108)' excel 2007 Lilandra Excel Discussion (Misc queries) 0 July 9th 09 11:16 PM
Error: method 'select' of object_worksheet' failed Carl Excel Discussion (Misc queries) 4 September 9th 06 08:52 PM
Method 'Range' of Object_Worksheet Failed Excel-erate2004[_21_] Excel Programming 23 September 2nd 04 05:49 AM
Excel Bug: Run-time error '-2147417848 (80010108)' majikman[_18_] Excel Programming 1 May 13th 04 08:16 PM
Run time error 2147417848(80010108) Praveen Excel Programming 4 December 18th 03 10:23 AM


All times are GMT +1. The time now is 03:31 PM.

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"