Error when printing an Excel sheet with .PrintOut: "the object invoked has disconnected from its clients"

fedepede21

New Member
Joined
Aug 5, 2014
Messages
1
Hi folks,

I'm new to this forum and an intermediate level user of Excel and VBA.
I have made a rather simple code in my Excel 2010 workbook/VBA project to print one sheet and at the moment I continuingly run into this nasty problem:
Excel occasionally gives me (only sometimes!) the error message "the object invoked has disconnected from its clients", and shuts down.

I have tried to look my problem up and find that I should use the Option Explicit on top of my code - only problem is that it is already there.

The code that I use is:

Code:
Private Sub Printtext_Click()


Ark11.Visible = True


Ark11.TextBox1 = ""


Ark11.TextBox1 = Me.LegText


Ark11.PrintOut


Ark11.TextBox1 = ""


Ark11.Visible = xlSheetVeryHidden


End Sub

The sub is run from a commandbutton on a userform that temporarilly puts the text from a textbox on the userform to a textbox on a hidden sheet to print it.

Any suggestions would be greatly appreciated!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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