I am trying to write some text to a document, separated by tabs. It works fine until a certain point, where I get the error: "The field is too small to accept the amount of data you attempted to add. Try insterting or pasting less data".
The message is pretty clear. However, I don't know why it occurs. My code is as follows. The error occurs in the line marked in bold.
Plotdata.AddNew
Plotdata!Command = "\tqr\tx" & 0 * twips & "\tab Km_start" 'Km_start
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(3 * twips, 0) & "\tab Afst1" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(4 * twips, 0) & "\tab L1" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(6 * twips, 0) & "\tab Afst2" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(7 * twips, 0) & "\tab L2" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(9 * twips, 0) & "\tab Afst3" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(10 * twips, 0) & "\tab L3" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(12 * twips, 0) & "\tab Afst4" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(13 * twips, 0) & "\tab L4" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(15 * twips, 0) & "\tab Afst5" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(16 * twips, 0) & "\tab L5" 'SH
Plotdata.Update
The strange thing is that this error does NOT occur, if I comment out the lines above, and only execute the following code:
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(15 * twips, 0) & "\tab Afst5"
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(16 * twips, 0) & "\tab L5"
This works fine, even though I do not change how far the text is tabulated (15*twips).
All this seems VERY strange to me! Did I miss anything?
Best regards
The message is pretty clear. However, I don't know why it occurs. My code is as follows. The error occurs in the line marked in bold.
Plotdata.AddNew
Plotdata!Command = "\tqr\tx" & 0 * twips & "\tab Km_start" 'Km_start
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(3 * twips, 0) & "\tab Afst1" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(4 * twips, 0) & "\tab L1" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(6 * twips, 0) & "\tab Afst2" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(7 * twips, 0) & "\tab L2" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(9 * twips, 0) & "\tab Afst3" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(10 * twips, 0) & "\tab L3" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(12 * twips, 0) & "\tab Afst4" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(13 * twips, 0) & "\tab L4" 'SH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(15 * twips, 0) & "\tab Afst5" 'KH
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(16 * twips, 0) & "\tab L5" 'SH
Plotdata.Update
The strange thing is that this error does NOT occur, if I comment out the lines above, and only execute the following code:
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(15 * twips, 0) & "\tab Afst5"
Plotdata!Command = Plotdata!Command & "\tqr\tx" & Round(16 * twips, 0) & "\tab L5"
This works fine, even though I do not change how far the text is tabulated (15*twips).
All this seems VERY strange to me! Did I miss anything?
Best regards