+ Reply to Thread
Results 1 to 8 of 8

How to ignore and proceed on run time error 91

  1. #1
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    How to ignore and proceed on run time error 91

    Hi Friends,

    Visiting here after long time as I got stuck at a place and need help. Thanks in advance.

    Problem - I am trying to open a existing spreadsheet (lets call it exstnSpSht) through another spreadsheet (currOpnSpSht). This gives me an run time error - 91 with two options 'END' and 'HELP'. I know why is this error but I dont have control to fix this error, so Iwant to ignore by theoritically press 'END' when this error pops up and proceed further to do my other operations.

    my small version of code :
    Please Login or Register  to view this content.
    ANy help is highly appreciated.

    Best
    Shammi

  2. #2
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: How to ignore and proceed on run time error 91

    try

    Please Login or Register  to view this content.
    might help
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  3. #3
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to ignore and proceed on run time error 91

    Thanks Raga. I tried it but it does not work in this situation.

    The error actually happens while trying to open a file from workbooks.open function in currentsheet - which opens the file and runs a private subrouitine macro workbook_open() which has a object which is not set.

    Hope this is making sense.

  4. #4
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to ignore and proceed on run time error 91

    To help understand my problem. I have attached a file, which I cannot modify and have no control ( I only wish).

    I am trying to open the attached file though my code that I copied above.

    So if anyone wants to try and experience my problem and help.


    Save this file in one of your folder.
    Open a blank spreadsheet and open VBA copy my code.
    and run it the code

    Thanks
    Shammi

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How to ignore and proceed on run time error 91

    Hi, shammi_Raj,

    use
    Please Login or Register  to view this content.
    I would avoid using On Error Resume Next in 99.9% of all cases.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to ignore and proceed on run time error 91

    Hahobe Hahobe --- Worked perfect - Thank you so much - I owe you a beer !!

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How to ignore and proceed on run time error 91

    Hi, shammi_Raj,

    the last line of code must read
    Please Login or Register  to view this content.
    Ciao,
    Holger

  8. #8
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to ignore and proceed on run time error 91

    Yeah figured that. thank you soo so much again Holger !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1