Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.67/5 (4 votes)
See more:
I have a VB6 program which reads from a data acquisition systems and displays it on excel sheets. I added a sub module to do some 3-4 more calculations from the values already displayed above on the sheet.
My problem is even for simple calculations like see line for EBW, EIBA.. my manual calculations and the ones done my VB have an error.
What am I missing?

code goes like
VB
Public Sub ISO13256ACOIL() 'A-Coil Option
On Error Resume Next
If TestType = 1 Then 'Cooling Test
    EBW = ((IDLvgStandAirflow * ESP) * 0.3918) 'Eqv. Blower Watts
    EIBA = EBW * 3.413 'Eqv. Indoor BTU Adjustment
    AIC = NetIDCapacity - EIBA 'Adjusted Indoor Capacity
    ETW = CompWatts + EBW + PumpPenalty 'Eqv.Total Watts
    AIAC = (AIC + ISOAvg) / 2 'Adjusted ISO Avg. Capacity
    EPPA = AIAC / ETW 'EER with Pump Penalty
    frmISO.txtEIBA.Text = Format(EIBA, "#.##") 'send results to form ISO
    frmISO.txtAIC.Text = Format(AIC, "#.##") 'send results to form ISO
    frmISO.txtEBW.Text = Format(EBW, "#.##") 'send results to form ISO
    frmISO.txtETW.Text = Format(ETW, "#.##") 'send results to form ISO
    frmISO.txtEPPA.Text = Format(EPPA, "#.##") 'send results to form ISO
    frmISO.txtAIAC.Text = Format(AIAC, "#.##") 'send results to form ISO
End If
If TestType = 2 Then 'Heating Test
    EBW = ((IDLvgStandAirflow * ESP) * 0.3918) 'Eqv. Blower Watts
    EIBA = EBW * 3.413 'Eqv. Indoor BTU Adjustment
    AIC = NetIDCapacity + EIBA 'Adjusted Indoor Capacity
    ETW = CompWatts + EBW + PumpPenalty 'Eqv.Total Watts
    AIAC = (AIC + ISOAvg) / 2 'Adjusted ISO Avg. Capacity
    EPPA = ((AIAC / ETW) / 3.413) 'COP with Pump Penalty
    frmISO.txtEIBA.Text = Format(EIBA, "#.##") 'send results to form ISO
    frmISO.txtAIC.Text = Format(AIC, "#.##") 'send results to form ISO
    frmISO.txtEBW.Text = Format(EBW, "#.##") 'send results to form ISO
    frmISO.txtETW.Text = Format(ETW, "#.##") 'send results to form ISO
    frmISO.txtEPPA.Text = Format(EPPA, "#.##") 'send results to form ISO
    frmISO.txtAIAC.Text = Format(AIAC, "#.##") 'send results to form ISO
End If
End Sub
Posted
Updated 1-Aug-14 5:25am
v2
Comments
CHill60 1-Aug-14 11:26am    
What is the error?!

There is not solution, this code is not complete, this routine use variables that are not in the listing.

So the only advice is to run this code with debugger and the variables when you have the error.

It would help if you give us the error message.
 
Share this answer
 
Comments
George Jonsson 5-Sep-15 5:53am    
Maybe a year too late?
Patrice T 5-Sep-15 6:32am    
:-) the question popped on top of list tonight and I didn't check the date.
Please pay attention to you variable data type.
Usually, variables EBW, EIBA.. should be define as Double type
 
Share this answer
 
Comments
George Jonsson 5-Sep-15 5:53am    
Maybe a year too late?
cyycoish 5-Sep-15 7:47am    
Good ideas never too late. :)
George Jonsson 5-Sep-15 18:26pm    
Good ideas, yes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900