Consulting

Results 1 to 7 of 7

Thread: How to find an error in my VBA !!

  1. #1
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location

    How to find an error in my VBA !!

    If I try to Save my VBA code or Spreadsheet I get a pop-up error message saying "Document not saved" ... so helpful !!!

    I am assuming this is because if I click Debug & choose "Compile VBAProject" I get a pop-up message saying "Invalid procedure call or argument" ...

    But, if I actually run the program, every part I try seems to work fine ... how do I find where this error is ?!?

    Thanks in advance ...

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Post the code, we are guessing otherwise.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    May 2008
    Posts
    198
    Location
    Are you using 'Option Explicit' in all of your code modules?

  4. #4
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location
    Quote Originally Posted by Cosmo
    Are you using 'Option Explicit' in all of your code modules?
    Yes I am ...

  5. #5
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location
    Quote Originally Posted by xld
    Post the code, we are guessing otherwise.
    How ? I can't save it to attach it & I don't particularly want to cut & paste every module & the code behind every UserForm ...

  6. #6
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location
    After searching the Internet, I noticed that some people got similar problems to this because their data was corrupt.

    I Exported all of my Modules & UserForms, created a new Spreadsheet & Imported all of my Modules & UserForms into the new sheet ... it now looks to be OK !!!

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    FYI you can post a workbook using Manage Attachments in the Go Advanced reply section.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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