Forum Discussion
SteVer1880
May 23, 2019Copper Contributor
Problem with text toolbox in connection with printing
I have created an excel form in O365. There i have set a text toolbox with (steuerelement) a scrollbar. to be able to enter a lot of text. If I enter now much text, so that the scrollbar becomes ac...
JKPieterse
May 23, 2019Silver Contributor
SteVer1880 Suppose your textbox is named TextBox1 and the codename of the worksheet it is on is Sheet1. Enter this code in the ThisWorkbook module:
Option Explicit Public OldHeight As Double Public OldWidth As Double Private Sub Workbook_BeforePrint(Cancel As Boolean) If ActiveSheet.Name = "Sheet1" Then OldHeight = Sheet1.TextBox1.Height OldWidth = Sheet1.TextBox1.Width Sheet1.TextBox1.AutoSize = True End If Application.OnTime Now, "ReSizeBox" End Sub
Insert a module and enter this code into it:
Option Explicit Sub ReSizeBox() With Sheet1.TextBox1 .AutoSize = False .Height = ThisWorkbook.OldHeight .Width = ThisWorkbook.OldWidth End With End Sub
- SteVer1880May 24, 2019Copper Contributor
JKPieterseand a second appendix with an error when compiling.
- JKPieterseMay 24, 2019Silver ContributorRelpace all "Sheet1." with "Tabelle1." (including the period but excluding the quotation marks).
- SteVer1880May 27, 2019Copper Contributor
Sorry, but it doesn't work. Unfortunately, not all content is printed yet.
In my case, the function with rezice before print does not seem to work.
I'am sorry !
- SteVer1880May 24, 2019Copper Contributor
JKPieterse thank“s for your support.
Please check my VBA-config (attachment)- i'm not shure if it is correct.
VBA is not my speciality :-(