We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
What is '400' in VB for Excel! it's soo annoying!!grr
Options

londonman81
Posts: 1,130 Forumite


in Techie Stuff
After writing and successfully running a VB macro in Excel, I get an error with just '400' and no other info when I run the macro again.
There is no clue as to what the problem is and just says '400' and fails to run!
I have run the macro perfectly the first few times and then without changing anything it suddenly says '400'.
The code is very simple and ran perfectly well the first few times.
There is no info on what this '400' is on Google - and it crops up everytime I run the macro now!
What the hell is this as it's totally annoying!!!
Grrrrr.....
L
There is no clue as to what the problem is and just says '400' and fails to run!
I have run the macro perfectly the first few times and then without changing anything it suddenly says '400'.
The code is very simple and ran perfectly well the first few times.
There is no info on what this '400' is on Google - and it crops up everytime I run the macro now!
What the hell is this as it's totally annoying!!!
Grrrrr.....
L
"To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott
0
Comments
-
can you step into the macro and find out the line that goes wrong, or post the code here so we can have a look.Ever stop to think and forget to start again?0
-
You normally get this when you're trying to overwrite something you shouldn't - usually a read-only property or an object not yet created or released.0
-
woo wrote:can you step into the macro and find out the line that goes wrong, or post the code here so we can have a look.
That's the problem - it doesn't go back to the macro and highlight in yellow the part that is causing the problem - and i can't step into it.
I'm using Excel 2003 and have noticed that it doesn't step back into the macro after an error like 2000 used to - which is very annoying too.
I'd like to be able to paste the code but it is work related and I'm a bit hesitant to disclose it..."To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott0 -
ManAtHome wrote:You normally get this when you're trying to overwrite something you shouldn't - usually a read-only property or an object not yet created or released.
Could you please expand slightly on 'overwrite something you shouldn't'??
The code is simple - just has 2 arrays that I'm filling up with number and them comparing the elements of the arrays to create a new list.
It just boils down to a couple of nested For loops...nothing complicated - and the first couple of times it worked fine....its so annoying when simple code doesn't work...
thanks for the reponses so far anyway!"To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott0 -
You're not running off the end of any of the arrays.? Could be worth adding something like:
if index1 > UBound(Array1) then debug.print "Blimey, array1 index overflow"
(and same for other arrays just before you reference each array entry)
By the way, this is based on earlier versions of Excel, haven't had a go at E2003 yet.0 -
ManAtHome wrote:You're not running off the end of any of the arrays.? Could be worth adding something like:
if index1 > UBound(Array1) then debug.print "Blimey, array1 index overflow"
(and same for other arrays just before you reference each array entry)
By the way, this is based on earlier versions of Excel, haven't had a go at E2003 yet.
I've just deleted and re-typed the code and it seems to work.
Then I typed another macro - very simple one - and it comes up again!!!!
It just seems to come up after every new macro I write!!!
It's sooo annoying because the code is so simple that nothing can be wrong with it!!
I hate VB Excel 2003 - i had never seen these errors before moving over to 2003!
How does one actually get in touch with Microsoft and get info on errors?!"To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott0 -
The M$oft support sites are pretty good
http://support.microsoft.com/
http://technet.microsoft.com/default.aspx0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.9K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.9K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.9K Life & Family
- 257.2K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards