+ Reply to Thread
Results 1 to 8 of 8

Odd VBA error

  1. #1
    Registered User
    Join Date
    02-03-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    5

    Odd VBA error

    Hello

    I have a xls file which I've used regularly for a few years and is c.4MB in size

    In the last few months I've at ad-hoc times been getting an error message regarding 'VBA' - something which I never use (or aware that I use!).

    The error box says 'Microsfot VisualBasic for Applications as the header' and then in the box says 'Can't find project or library'.

    A little googling has said that I should hit Alt+ F11 and then go to tools>>references and remove anything which says 'missing'. However when I do this, I can go to Tools, but whilst References is there and not greyed out, I am unable to click on it (or if I click on it it does nothing).

    I've tried re-installing Office; sometimes this works, sometimes it doesnt. Does anyone have any idea about what this is or might be causing it, and obviously how I prevent it?

    Any advice very gratefully received!!!
    Thanks

    Adam

  2. #2
    Registered User
    Join Date
    02-03-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Odd VBA error

    Sorry - one addition. This error prevents me from saving the file, or I get a warning saying that if I save it I will lose some features

  3. #3
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Odd VBA error

    It may be the fact you are running a very old file (.xls) with your 365 - try saving the file as .xlsm (macro enabled) and see if that is more stable.
    torachan.

  4. #4
    Registered User
    Join Date
    02-03-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Odd VBA error

    Hi Torachan

    Thanks for the swift reply. Just checked and its already a .xlsm file I'm afraid. Are there any other tips which you might have?
    Thanks

    Adam

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Odd VBA error

    If you aren't using VBA, why is the file saved in macro-enabled format (.xlsm) rather than a non-macro format (.xlsx)? Are you using any old XLM macro functions in defined names?
    Rory

  6. #6
    Registered User
    Join Date
    02-03-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Odd VBA error

    Hi Rorya

    I'm not sure what requires a macro format excel and what doesnt. I use the Data function in Excel to import share prices, I link a few things to other files, I use conditional formatting, some data tables etc. Everything else is relatively standard excel.

    However I haven't written any macros for it. What requires VBA or a macro enabled workbook?
    Thanks

    Adam

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Odd VBA error

    Adam

    What happens if you save the file as xlsx?
    If posting code please use code tags, see here.

  8. #8
    Registered User
    Join Date
    02-03-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Odd VBA error

    hmmm I opened the document on a different laptop (I have the file saved in OneDrive) and didnt get the error message. So I opened it again it on my normal laptop got the error message...but then tried it again 30 mins later and the error message has gone away on my normal laptop too.

    Might it be a problem with excel on my normal laptop rather than the file? I've run the repaid function for Office on my laptop...though not fully uninstalled it re-installed it yet

    Norie - thanks for the reply. However because the error message hasn't come up, I can't now say what would be the impact of that!
    Last edited by AdamB1978; 02-03-2021 at 08:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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