Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Textbox Bug? Missing/delayed update of textbox filled via VBA

Hi,

I've found a strange behaviour regarding the Textbox object in a Excel 2003
worksheet (using Windows XP Prof.)
The result my test code procudes is depending on whether I manually change
the text inside the textbox object or not.

The task(simplified):
- I have a list containing X entries
- I have a worksheet containing one textbox (called TEXT1); the worksheet is
a kind of a template used to produce reports.
- each of those entries should be written into the textbox using a loop in a
VBA procedure and the worksheet should be printed in a file using the
Printout method.

Expected result:
- there should be X files (*.PS) with a textbox containing one of the X list
entries

The problem:
- Excel seems to have a problem to update the textbox before it sends the
worksheet to the printer (looks like an application.screenupdating=false
issue, but it isn't); all of the X files contain the first list entry only!
- But: Excel seems to work as expected, if I manualle change the textbox's
content just before I run the VBA code; each of the files contain a textbox
showing a different value!

= This behavior looks very strange to me. Hope that somebody could help me :)

Thanks!
Marc


The code:
- Textbox "TEXT1" should be on Sheet1 (using standard properties of textbox)

Sub createReport()
Dim i As Integer

Application.ScreenUpdating = True
For i = 1 To 5
Sheets(1).TEXT1.Text = "List entry: " & i
printSheet (i)
Next i

End Sub

Sub printSheet(i)
ActiveSheet.PrintOut PrintToFile:=True, ActivePrinter:="Fineprint 2000",
PrToFileName:="Test " & i & ".ps"
End Sub

-------------------------------
Marc Mueller
Switzerland
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM
How to move cursor from one textbox control to another textbox con Tom Ogilvy Excel Programming 1 September 16th 04 03:42 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM
Textbox object does not update jay Excel Programming 0 August 1st 03 03:56 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"