Forum

Notifications
Clear all

VB Error Code 400

8 Posts
4 Users
0 Reactions
122 Views
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

I just purchased a new computer and added Office Professional Plus 2016. When I tried opening my Microsoft Excel macro file, I received the error code 400 and it shutdown.  The file was originally created with the 2007 version and later saved in the 2013 version.  Do you know what caused the problem and how to fix the issue?  I contacted Microsoft and one particular team could not fix it.  

Any assistance is greatly appreciated.

 
Posted : 17/01/2019 11:14 pm
(@debaser)
Posts: 836
Member Moderator
 

Can you post the file?

 
Posted : 18/01/2019 6:31 am
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

it is a huge file 100,000mg with many macros

 
Posted : 18/01/2019 1:00 pm
Anders Sehlstedt
(@sehlsan)
Posts: 968
Prominent Member
 

Hello,

Seems likely to be some macro code that causes this. Did a search and found this topic in a different forum. Perhaps it can help you forward in finding the culprit.

https://forums.techguy.org/threads/solved-vba-error-400-running-an-excel-macro.775340/

 
Posted : 19/01/2019 2:09 am
(@debaser)
Posts: 836
Member Moderator
 

Do you have code that runs automatically when the workbook opens? If so, please post it, otherwise it's all going to be random guesswork.

 
Posted : 19/01/2019 4:30 am
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Velouria,

No I have to activate each macro.  A similar issue occurred with a different file and our field support tech fixed the problem, but he is no longer with us.  I don't know what the tech did and notes were not saved in the work order.  I will take a look at the website that Anders provided and see if it helps.

Thanks

 
Posted : 19/01/2019 11:26 am
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

As the macro was running, it highlighted in yellow "tmp_Frequency = FrequencyArrray(j)

 

This is the code.  Do you see a problem with the code?

'sort the arrays with by bubble sort, sorting Actuals

i = 0

j = 0

For i = 0 To colCount - 1

 For j = 0 To (colCount - 1 - i)

  If (ActualArray (j + 1) > ActualArray(j)) Then

tmp_Actual = ActualArray(j)

tmp_Frequency = Frenquencyarray(j)

tmp_FrequencyFormula = FrequencyFormulaArray(j)

ActualArray(j) = ActualArray (j + 1)

FrequencyArray(j) = FrequencyArray(j+1)

FrequencyFormulaArray(j) = FrequencyFormulaArray(j+1)

ActualArray (j+1)= tmp_Actual

FrequencyArray(j+1) = tmp_Frequency

FrequencyFormulaArray(j+1) = tmp_FrequencyFormula

End If

Next j

Next i

 
Posted : 20/01/2019 4:50 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Melanie

I saw a spelling error 

tmp_Frequency = Frenquencyarray(j) 

Should be Frequencyarray

No idea if it is the cause. 

Sunny

 
Posted : 21/01/2019 12:02 am
Share: