M
Mats Samson
In my Excel purchase, order and invoice application I would like to use
predefined textblocks and insert them to the document I’m creating.
I previously had an array created by the userform initialization that kept a
limited amount of predefined texts. I wanted to increase the number of text
blocks and decided to create a small “database†in a worksheet, attach it to
a combobox in the registration userform from where I chose the text block to
be inserted in a temporary text area, a named cell.
The chosen text blocks are copied to a multi line textbox in the userform
where I can “stack†several text blocks showing up in the final document.
This textbox is connected to the “system pageâ€, a number of cells containing
all the information for an order or invoice. (When the document is finally
registered all the information is copied to a document database for later
retrieval.)
To use a database connected combobox worked well during creation but saving
and reopening the workbook and starting the registration, I get “Exception
Occured†as soon as I select one of the text blocks. I cannot find any
explanation to what Exception occurred really is, thus finding a way of
solving the problem.
Private Sub CBx407_AfterUpdate() ‘ The combobox
CBx407.Copy
End Sub
Private Sub Btn41TL_Click() The button copying the text block in focus
Range("TexTemp").Copy
TxB419.Paste
Application.CutCopyMode = False
End Sub
Private Sub TxB419_AfterUpdate() ‘The textbox updates the “system†textline
cell
Range("_TL1") = TxB419.Text
End Sub
There is also another problem connected to the textblocks. If I retrieve a
saved document containing several lines of text it often happens that the
application freezes.
I’m guessing that copying the stored information containing a multiline text
in a cell and pasting it to the cell that controls the textbox is the
problem. The textbox cannot manage to load a big chunk of text and display it.
Is there any decent way to solve this? It cannot be such an unusual task to
use a textbox when loading and displaying a lot of text!
predefined textblocks and insert them to the document I’m creating.
I previously had an array created by the userform initialization that kept a
limited amount of predefined texts. I wanted to increase the number of text
blocks and decided to create a small “database†in a worksheet, attach it to
a combobox in the registration userform from where I chose the text block to
be inserted in a temporary text area, a named cell.
The chosen text blocks are copied to a multi line textbox in the userform
where I can “stack†several text blocks showing up in the final document.
This textbox is connected to the “system pageâ€, a number of cells containing
all the information for an order or invoice. (When the document is finally
registered all the information is copied to a document database for later
retrieval.)
To use a database connected combobox worked well during creation but saving
and reopening the workbook and starting the registration, I get “Exception
Occured†as soon as I select one of the text blocks. I cannot find any
explanation to what Exception occurred really is, thus finding a way of
solving the problem.
Private Sub CBx407_AfterUpdate() ‘ The combobox
CBx407.Copy
End Sub
Private Sub Btn41TL_Click() The button copying the text block in focus
Range("TexTemp").Copy
TxB419.Paste
Application.CutCopyMode = False
End Sub
Private Sub TxB419_AfterUpdate() ‘The textbox updates the “system†textline
cell
Range("_TL1") = TxB419.Text
End Sub
There is also another problem connected to the textblocks. If I retrieve a
saved document containing several lines of text it often happens that the
application freezes.
I’m guessing that copying the stored information containing a multiline text
in a cell and pasting it to the cell that controls the textbox is the
problem. The textbox cannot manage to load a big chunk of text and display it.
Is there any decent way to solve this? It cannot be such an unusual task to
use a textbox when loading and displaying a lot of text!