ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automation Error (https://www.excelbanter.com/excel-programming/326148-automation-error.html)

Stuart[_21_]

Automation Error
 
The error report says:

Run-time error '-2147417848(80010108)':
Automation error
The object invoked has disconnected from its clients

This occured as follows:

I clicked an addin's menu item (Master Fax).
A form (FormMasterFax) was shown.
I entered data into a large multiline textbox on the form.
I then clicked on another textbox control in that form, and the error was
raised.

This form has only recently been created, but this error has already
occurred a couple of times. The only consistency that I see so far is the
exiting of that multiline
textbox.....but by no means every time I exit.

When the debug option is followed, I am taken to the
following sub

Private Sub Master_Fax()
FormMasterFax.Show
End Sub

which is in a standard module in the addin. The Show
is highlighted. Stepping through gives the message that the
form is already displayed and cannot be shown modally.

This particular textbox is different from others on that form in one
(possibly significant) respect: exiting the textbox results in a
spellchecking routine on the contents.
Here is the code:

Private Sub TbFaxMsg_Exit(ByVal Cancel _
As MSForms.ReturnBoolean)
With Workbooks("G&H Project.xla")
.Worksheets("Fax Template").Unprotect
.Worksheets("Fax Template").Range("B82") _
.Value = Me.TbFaxMsg.Value
.Worksheets("Fax Template").Range("B82") _
.Resize(2).CheckSpelling
End With
With Me.TbFaxMsg
.Value = Workbooks("G&H Project.xla") _
.Worksheets("Fax Template").Range _
("B82").Value
Workbooks("G&H Project.xla").Worksheets _
("Fax Template").Range("B82").ClearContents
End With
End Sub

As I say this does not happen anywhere near all the time, but so far seems
only when exiting this particular textbox.

Any ideas, please?

Regards.




All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com