Read/Write Excel Sheet OBjects

elPit
03-18-2003, 09:57 AM
Hello, I'm doing a Visual Basic Project using interaction with Excel. I found a problem when i try to write or read a "TextBox" on an Excel sheet, as simple as i don't know how (even read a book).

By now i have this:

----------------
Dim Control As Worksheet
Dim Status As OLEObject
Set Control = Logiciel.Worksheets("Control")
For Each Status In Control.OLEObjects
If Status.Name = "StatusTextBox" Then GoTo Trouve
Next Status
Trouve:
'code needed for write and read my textbox called StatusTextBox
------------------
How can i do?

Another question is how can i display a window (can be a VB form) with out stop running my code.

elPit
03-18-2003, 10:05 AM
Sorry, I forgot to say thanks.

Wamphyri
03-18-2003, 10:22 AM
You need to use Object.Value

'to write
Status.Object.Value = "Hello World"
'to read
myText = Status.Object.Value


P.S.

I wouldn't use Control as a variable name since it is a keyword.
Dim Control As Worksheet

elPit
03-19-2003, 06:00 AM
Thanks a lot!, it was simple and it worked great.
Muchas gracias amigo. elPit.

elPit
03-21-2003, 02:12 PM
Hi, I'm still having problems writing to excel objects, I wonder if it's posible to modifie the cells range of a certain chart, graphic, from my visual basic code.
By now I'm able to take the object but in it' propertis I don't find the range of cells that it affects to.

Thanks. elPit.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum