Automation Error

cme044

New Member
Joined
Jul 7, 2011
Messages
5
Brief Summary: A userform is given and the user enters in values which are then put into an excel spreadsheet and a value is calculated. I want that final value (PressureDrop/PressureDropPa) to display in the userform.

The program works perfectly on one computer, but as soon as I open it on another computer I get the error: Run-time error '-2147417848 (80010108)': Automation error The object invoked has disconnected from its clients.


Code:
Private Sub Clear_Click()
Unload Me
UserForm4.Show
End Sub

Private Sub CalculatePressure_Click()
Worksheets("Model-Metric").Range("L29") = TD1Row1.Value
Worksheets("Model-Metric").Range("L31") = HD1Row1.Value
Worksheets("Model-Metric").Range("L30") = VD1Row1.Value
Worksheets("Model-Metric").Range("M29") = TD2Row1.Value
Worksheets("Model-Metric").Range("M31") = HD2Row1.Value
Worksheets("Model-Metric").Range("M30") = VD2Row1.Value
Worksheets("Model-Metric").Range("M33") = DegBends2.Value
Worksheets("Model-Metric").Range("M34") = RofC2.Value
Worksheets("Model-Metric").Select
BendRadiusRatio_Change
PressureDropPa_Change
PressureDrop_Change
 
End Sub
 
 
Private Sub BendRadiusRatio_Change()
Dim Br As Integer
Br = RofC2 / (TD2Row1 / 1000)
If Br < 6 Then
Worksheets("Model-Metric").Range("M36") = -0.375 * Br + 2.25
Else
Worksheets("Model-Metric").Range("M36") = 0.5
End If

End Sub
 

Private Sub PressureDropPa_Change()
 
Dim PressureDMetric As Range
Set PressureDMetric = Range("G38")
PressureDropPa.Value = PressureDMetric
PressureDropPa.Value = Format(PressureDropPa, "fixed")

End Sub
 
 
Private Sub PressureDrop_Change()
 
Dim PDropMetric As Range
Set PDropMetric = Range("H38")
PressureDrop.Value = PDropMetric
PressureDrop.Value = Format(PressureDrop, "fixed")
 
End Sub


Any suggestions are greatly appreciated!

Thanks

Chels
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Is there no indication as to which line of code it stopped at?
 
Upvote 0
It stops at

Code:
Private Sub PressureDropPa_Change()

Though I changed

Set PressureDMetric = Range("G38") 'to

Set PressureDMetric = Cells(38, 8)

and now it works...
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,348
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top