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

World: r3wp

[Windows/COM Support]

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
[477x2]
%d is an integer mask
 --- oops, I confused it with Rebol's decimal!
In COMLib-anton, decimal! is not currently implemented. I think that 
was because none of the demos used it
james_nak
22-Oct-2011
[479]
When my Skype client upgraded itself my Rebol Skype app which I use 
to switch audio in and out sources failed. Turns out the the new 
Skype4com.dll (1.0.36) needs to have those NULL's when using getobject. 
Thanks to Graham for mentioning the use of NULL awhile back. Oh, 
a great app I used to register and unregister the dll's while testing 
is RegDllView http://www.nirsoft.net/utils/registered_dll_view.html.
GrahamC
22-Oct-2011
[480]
James .. what is this application?  And what exactly does it do?
james_nak
22-Oct-2011
[481]
Actually I based it on your skype.r app. All it does is set the audioin 
and audioout settings. I have a Plantronics bluetooth handset and 
earpiece but it doesn't support Skype voicemail messages so every 
time I received one I had to go to the tools and switch out the audio 
to my computer speakers and back again. It also seems to cause some 
slight interference when I had to enter touchtones so I wrote this 
little gui that simply lets me change those. Nothing special but 
it is a real time saver and with the touchtones a call saver since 
you have to enter tones pretty qucikly sometimes.
GrahamC
22-Oct-2011
[482]
Good to know I'm not the only person using Skype with Rebol
james_nak
22-Oct-2011
[483]
Well, it's thanks to you Graham. I noticed that the original twitter 
client in RebolTutorial used your http-tools.r
Luis
22-Oct-2011
[484]
James, Is your switch audio code public ?
james_nak
23-Oct-2011
[485]
Luis, I just uploaded it to rebol.net. It's called myskype.r 

One weird thing that happened when I was getting it ready to post 
was that it stopped working with Skype4com.dll version 1.0.36. It 
started doing the same thing in spite of the NULL. I noted that in 
the file and went back to 1.0.33.
GrahamC
23-Oct-2011
[486]
rebol.org
james_nak
23-Oct-2011
[487]
Yeah, sorry. .org. It's late here. I was reading up on the Skype 
1.0.33 and it looks like there were some install and usage issues 
though I don't know if that has anything to do with what I was experiencing.
Luis
24-Oct-2011
[488:last]
Thanks for share your work !