r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Windows/COM Support]

Anton
30-Oct-2008
[428]
But I can see in the word-open-save.r demo I have done this:

	do/args %../COMLib.r [
		...

  word_doc: GetObject [word_obj ".Documents.Open(%s)" to-local-file 
  clean-path %demos/word-open.doc]
Robert
30-Oct-2008
[429x2]
Anton, yes.
I solved it the same way with to-local-file works, but not elegant.
Anton
4-Nov-2008
[431]
Yes, not elegant. I'm sorry.
Graham
20-Nov-2008
[432x2]
Anton, how would one do the example here 

http://www.oooforum.org/forum/viewtopic.phtml?t=9815&postdays=0&postorder=asc&start=0

In particular, this line

Set doc = Stardesktop.loadComponentFromURL("private:factory/swriter", 
"_blank", 0, args)

where args has been defined as Dim args()
the func is described here http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html
james_nak
22-Nov-2008
[434]
Is it possible to write a windows "service" (a program running as 
a service) with rebol?
Graham
22-Nov-2008
[435x2]
doc has software to do this
it's part of the Cheyenne distribution
james_nak
22-Nov-2008
[437]
Thanks Graham.
Dockimbel
22-Nov-2008
[438]
Windows Services support: http://softinnov.org/rebol/nt-services.shtml
james_nak
23-Nov-2008
[439]
Thanks Doc
Graham
9-Feb-2009
[440]
Dunno what's changed by Skype but REBOL Skype Sms texting is working 
again on Vista.
Robert
13-Jul-2009
[441x6]
Hi, just getting my hands back on control Excel via ComLib. How do 
I get a value back?
I saw there is GetString, GetInteger etc. but don't know how to use 
it.
The Comlib.r code states this in the comment sections:

		;GetString [xlApp ".ActiveSheet.Cells(1,10)"]
But doesn't seem to work...
Ok, as so often, posting my problems seems to enlighten me to get 
it fixed.
I was changing a file in an other directory not the one the base 
script was in...
Robert
15-Jul-2009
[447x5]
Trying to get a decimal! into an excel cell. I use:


sendValue excel-app ".ActiveSheet.Cells(%d,%d) = %f" reduce [row 
col val]


But this leads to strange content. What's the C-type of a Rebol decimal!
From the DLL docs it's float/double but doesn't seem to work...
Ok, it's not %f in DistHelper/COMLib but %e...
But now I get garbage to Excel...
Comlib.r is missing a way to pass decimal! / floats. I extended it. 
Seems to work at least with XLS.
james_nak
15-Jul-2009
[452]
Robert, on a recent project my app creates an xml file formatted 
with xml that Excel understands. It's a hassle but you can make very 
pretty spreadsheets that do just about all the formatting (so it's 
a far cry from CSV). I start with creatinga very small excel spreadsheet 
then saving as an xml file. Then I check out how they do the formatting. 
You can create multiple tabbed spreadsheets very easily this way. 
Doesn't do graphs though.
Reichart
15-Jul-2009
[453]
James, this is EXACTLY how I do this type of thing.  Let the tools 
do all the examples...
Maarten
16-Jul-2009
[454]
Yes! Being an experimental physicist it always strikes me as funny 
that we don't have a branch called "experimental computer science". 
Computers may be predictable, but humans (you know, that design XML 
formats, or have a ship cut an Internet cable in the Pacific, or....) 
are not.
Robert
16-Jul-2009
[455x2]
Well, I really like COMLib. It's pretty straight forward and the 
COM sutff is one of the better things MS did. It works and is a pretty 
simple concept.
And, I not just need to generate XLS files I need to read data from 
XLS files as well that don't use an XML format.
james_nak
16-Jul-2009
[457]
Point taken. Robert.
Robert
29-Jul-2009
[458x2]
Any idea how I can get rid of the "Do you want to save changes" dialog 
when I close an XLS workbook?
I hate VBA... I tried:
 sendValue 	 excel-app ".DisplayAlerts = %s" "False"
and

 objectMethod excel-app ".ActiveWorkbook.Close(SaveChanges:=False)"


both with no effect. To be more specific, the effect is that ComLib/Disphelper 
just exit.
ChristianE
29-Jul-2009
[460]
Have you already consulted http://support.microsoft.com/kb/213428/EN-US/
? Maybe that's what you're looking for.


The trick seems to be to do set ThisWorkbook.Saved = True, so that 
Excel responds as though the workbook has already been saved and 
no changes have occurred since that last save.
Robert
29-Jul-2009
[461x2]
I did. And I solved it. The problem is that ComLib didn't knew about 
logic! and XLS uses TRUE/FALSE as logic value not as string.
Now it works.
Robert
1-Sep-2009
[463x2]
Hi, I'm again struggeling with XLS automation via ComLib.
I want to do:

VBA-Code: ActiveSheet.Copy After:=Workbooks(2).Sheets(3)
	

And I use:
								

objectMethod excel-app ".ActiveSheet.Copy After:=Workbooks(%d).Sheets(%d)" 
reduce [workbook worksheet]



But this doesn't work. XLS creates a new document with the copy worksheet 
inserted. Looks like the stuff after .Copy isn't recognized. Any 
idea?
Anton
27-Dec-2010
[465x2]
Graham asked, when using COMLib-Anton, can you pass a decimal to 
Excel?
Well, looking at the demos/excel.r file, you can see integers being 
passed in with %d in the format string.

That file worked for me last time I tried it, as I noted in the script 
header. That would have been on WinXP.
GrahamC
27-Dec-2010
[467]
Yes, and %d is an integer mask so decimals passed to it end up as 
integers
Robert
27-Dec-2010
[468x2]
I have extened the excel dialect to handle decimal! as well. The 
code in the dialect looks like this:


                | ['set | 'change] opt 'cell set row integer! set col integer! set 
                val [string! | integer! | decimal!] (
                		; ? val
                		; print [row col]
                		switch type?/word val [
                			string!  [
                				; filter all illegal characters
                				replace/all val {"} "'"
                				replace/all val {,} " -"
                				replace/all val newline "; "

                    sendValue excel-app ".ActiveSheet.Cells(%d,%d) = %s" reduce [row 
                    col val]
                			]

                   integer! [sendValue excel-app ".ActiveSheet.Cells(%d,%d) = %d" reduce 
                   [row col val]]

                   decimal! [sendValue excel-app ".ActiveSheet.Cells(%d,%d) = %e" reduce 
                   [row col val]]
                		]
I will update the excel dialect on my homepage as soon as I'm back 
home.
GrahamC
27-Dec-2010
[470]
This looks like Benjamin's original comlib ?
Robert
28-Dec-2010
[471]
I'm not sure, as I blended the two and made some changes. What I 
remember is, that I had to add support for decimal! to the excel 
dialect I used.
GrahamC
28-Dec-2010
[472]
Has anyone used these dialects to generate server side Excel spreadsheets 
and then returned them to the browser?
Robert
29-Dec-2010
[473]
No, but if you want to do this, create HTML files with XLS endings 
using TABLE. Excel will magically load these as normal XLS files 
;-)
GrahamC
29-Dec-2010
[474]
table?
Robert
29-Dec-2010
[475]
HTML TABLE I mean.
GrahamC
29-Dec-2010
[476]
interesting ...
Anton
30-Dec-2010
[477]
%d is an integer mask
 --- oops, I confused it with Rebol's decimal!