none
Object is not registered Huh? RRS feed

  • Question

  • Why am I getting this error?

    This code worked for the last three weekends.  Four weekends ago and again today, I got this error every time this sub routine is called (hourly)

    (Excel/Developer/VBA)

      ==============================================


    Sub Close_URL()  'June 21, 2015
    'Close the URL after the designated time

        ThisURL = Z
        sURL = Z
        Dim obj As Object: Dim ie As Object
        Set obj = CreateObject("shell.application")
        For Each ie In obj.Windows                                '<<   "Object is not registered: THis lime is highlighted when the error occurs.
        Range("AB1").Value = Range("AB1").Value + 1
        Range("AC1").Value = Range("AC1").Value + 1
        Range("AB3").Value = (Now)
         Range("AC3").Value = (Now)
           On Error GoTo ForgetMe
                Range("AB1").Value = Range("AB1").Value - 1
                Range("AB3").Value = (Now)
                If TypeName(ie.Document) = "HTMLDocument" Then
                        ie.Quit
                     Exit For
                End If
    ForgetMe:
        Next

    End Sub
    Saturday, April 28, 2018 1:37 PM

All replies

  • Hi GarySut,

    I cannot reproduced the issue only with code you provided.

    Please provide more information.
      about variables: Z, ThisURL, sURL
      about value in cells "AB1", "AC1", etc.
    It would be the best, if you share your file via cloud storage (e.g. OneDrive, Dropbox, and so on). 

    Regards,

    Ashidacchi -- http://hokusosha.com/

    Monday, April 30, 2018 1:15 AM
  • Hi GarySut,

    I try to make a test on my side.

    I find that code is working correctly without any issue.

    Below is the debugging result you can have a look.

    I suggest you to manually call this sub and check whether object for shell application created properly or not.

    If object not created properly then this error can be occur.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 30, 2018 2:00 AM
    Moderator
  • Hi GarySut,

    Is your issue solved?

    I find that you did not follow up this thread after posting the issue.

    If your issue is solved then I suggest you to post your solution and mark it as an answer.

    If your issue is still exist then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 3, 2018 9:35 AM
    Moderator