none
Error -2147467259 (80004005) RRS feed

  • Question

  • hi guys,

    i'm totaly a newbie with vba in excel. Right now i have created a msg box with the option to hide a message. the code is
    Private Sub Worksheet_Activate()     
         
        Dim hidemessage As Boolean, p As Variant
        If ThisWorkbook.CustomDocumentProperties.Count > 0 Then
            For Each p In ThisWorkbook.CustomDocumentProperties
                If p.Name = "hidemessage" Then hidemessage = False
                 
            Next
        End If
        If Not hidemessage Then
            If MsgBox("hoi papa en" & ActiveSheet.Name & vbNewLine & "Click no to not show this message again", vbYesNo)  = vbNo Then
                ThisWorkbook.CustomDocumentProperties.Add "hidemessage", False, msoPropertyTypeBoolean, True
            End If
        End If
         
         
        Worksheets(" Bas").Range("e8").Clear
         
         
         
         
    End Sub


    when i press yes the script is running correctly but when i press no i get the error -2147467259 (80004005)  automation error. how to resolve this problem.
    Friday, October 18, 2013 6:43 PM

Answers