File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
All Forums
Origin Forum for Programming
LabTalk Forum
Setting text in a cell...
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
LabTalk Forum
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2016 Operating System: 64 bit Win 7 I am sorry that this is an old question, but I always seem to forget how to do this... How do you programmatically write text data to a cell? I always seem to find ways that don't work... If you define a range range op = [Summary]Sheet1!2[1]; Then set it equal to a number op = 2; Then it works, but if you write op = "Test" you just get "--" in the cell. Using 'cell' notation seems to work [Summary]Sheet1!cell(1,2) = "test" but this always looks a bit odd to me... is 'Cell' a function here, stuck to a snippet of range notation? In fact, why isn't the part that says "[Summary]Sheet1!" handled as a 'string literal' with quotes? ("Summary" is an arbitrary 'name' right?) To give some context, I am normally grabbing data from many different workbooks in a "doc ef LB{}" loop and want to copy the name of the workbook into each line of the output summary/analysis because the order in which the workbooks is processes is not something I can rely upon. Logging the workbook name in a column means I can always match up the operating conditions of each of the datasets. I found that this works (j is some loop variable that counts where I am in the loop through workbooks) Summary!cell(j,1) = %(page.name$); But I am confused that if I type page.name$= at the command window it tells me the (string) name of the book, but if I ask the script window to report the value "%(page.name$)=" it gives an empty string. If I leave out the %() part then in the context of a script it doesn't work... jdf
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000