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.
Can you post the file?
it is a huge file 100,000mg with many macros
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/
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.
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
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
Hi Melanie
I saw a spelling error
tmp_Frequency = Frenquencyarray(j)
Should be Frequencyarray
No idea if it is the cause.
Sunny