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

World: r3wp

[All] except covered in other channels

[unknown: 5]
1-Aug-2008
[2893x3]
Dim xlApp As Object = CreateObject("Excel.Application")
Dim xlWB As Object = xlApp.Workbooks.Open("C:\Path\Filename.xls")
xlWB.Worksheets(1).Select()

xlWB.SaveAs(Filename:="C:\Path\FileName.txt", FileFormat:=-4158, 
CreateBackup:=False)
xlWB.Close()
xlWB = Nothing
xlApp.Quit()
xlApp = Nothing
It looks like it is supposed to automate opening an Excel doc and 
then converting it to save it as a tab-deliminated file which would 
be perfect for me to then use REBOL to parse that file.  However, 
I tried saving this data in file with a .vbs extension but it gives 
me an error after the first line which says "Expected End of Statement". 
 I have no clue how to fix it as this code came off the net.
I'm sure I'm doing something wrong but not sure what that is.
Gregg
1-Aug-2008
[2896x4]
Two things I've done--mention before I believe. One is an Excel control 
dialect. It doesn't let you control everything, and requires a non-REBOL 
DLL I wrote, which is free to use. The other is a send-keys dialect 
that lets you pump keystrokes to apps. You should be able to do the 
above process with that.
The above code looks like regular VB. I never did vbs, so I don't 
know detail differences. For example, you can run VBA in a host app 
(e.g. Excel) that uses it as a macro language, but maybe the command 
prompt doesn't support all the same things, like variable declarations.
It looks like it's just line-wrapping in altme that's breaking the 
lines. VB is line oriented, requiring a line continuation character 
for multiline statements.
Does the WSH give you any other info about the error?
[unknown: 5]
1-Aug-2008
[2900x4]
Yeah it looks like it breaks at the 11 character on line 1.
I actually have another script (its at work) and it uses ADO.  But 
it gives me an error but does seem to out put the data.  I also think 
I have another route which is to record a macro in excel save the 
macro to another workbook and then modify the macro to launch on 
open.  I haven't figured out the code to launch a macro on open of 
the workbook but did find out how to launch a message on open.  So 
I think I'm close.
If I go the macro route then I can use the call command to call excel 
and the macro workbook which will perform actions on the other excel 
file.
kinda ugly way of doing it I suppose but gets the job done.
Brock
2-Aug-2008
[2904x2]
what about  a microsoft tool called Log Parser?  It allows command 
line access to files and can also do things like file format conversions 
and simple manipulations etc.   http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx
It's a command-line tool, so could easily call it from Rebol.
Gregg
2-Aug-2008
[2906]
Does VBA under WSH not support typed declarations or inline assignment 
against them?
[unknown: 5]
2-Aug-2008
[2907x3]
Not sure what that means Gregg.
Brock, I gotta use the resources on the machine with the only other 
introduction to be REBOL.
There are major rules against outside software.
Brock
2-Aug-2008
[2910]
Paul, okay, I recall you saying that.  But the fact that the small 
command-line tool is Microsoft, they may look the other way.  Besides, 
I don't know for sure if it would work for you, but may be worth 
taking a look at.
[unknown: 5]
3-Aug-2008
[2911]
I don't think it can read native XLS can it?  Doesn't the XLS file 
still need to be converted first for logparser?
Brock
3-Aug-2008
[2912]
A closer look and no it does not.  I got some of the input and output 
formats confussed.  I thought it could read from a SQL/ODBC data 
source but appears that is only an output format.  There is a COM 
api, but that might be more complex than is worth.
[unknown: 5]
3-Aug-2008
[2913]
After looking at it, I believe someone could easily build a more 
powerful utility using REBOL than what logparser is.
Gregg
3-Aug-2008
[2914]
What I mean is, does it support

Dim xlApp
Dim xlApp As Object
Dim xlApp As Object = CreateObject("Excel.Application")


The first is just a declaration, the second adds a type to it (rather 
than making everything a Variant), and the third adds inline assignment 
to the declared variable.
[unknown: 5]
3-Aug-2008
[2915]
I don't really know much about VBA.
PeterWood
3-Aug-2008
[2916x4]
This is a msft example of calling Excel from VBScript - http://support.microsoft.com/kb/198703/
This one is mainly JScript but shows more examples of controlling 
Excel - http://support.microsoft.com/kb/234774
Both are shown being called from IE but they should also work under 
WSH.
and to answer Gregg's question, it appears to support

	dim app
	set app = createobject("Excel.Application")
[unknown: 5]
4-Aug-2008
[2920]
Thanks Peterwood.  Those seems helpful if I need to just call and 
interact with Excel but I need to actually retrieve rows in an automated 
fashion and be able to parse them in a tab-delimited manner.
[unknown: 5]
13-Aug-2008
[2921]
I have another fantasy football league that is seeking another member. 
 This is USA Football which is different then european football which 
we call soccer.  The fantasy football league is ran via Yahoo.  The 
league fee is only $35 bucks.  Great for those wanting to start their 
first time.  All newcomers draft last but it is a snake order draft 
which means the last person goes first in the every other round. 
   The draft is currently scheduled for Sat Aug 23 9:30am CDT.  Gonna 
be a blast - this is my third year in this league and it is very 
active.  Lots of smack talk in this league but lots of fun.  Serious 
takers only please.  Even if you submit this opening might get filled. 
 I still have the REBOLers league which is wide open.
[unknown: 5]
14-Aug-2008
[2922x3]
This league is now full.
Were at 12 now and we are considering going to 14 but only if we 
can get 14 before draft day.  We had 14 last year and it was ver 
competative due to the lack of player talent to choose from.
So if you have an interest let me know but if your looking for a 
league continue to look elsewhere also.
Gregg
11-Sep-2008
[2925]
New REBOL articles: http://hostilefork.com/
james_nak
11-Sep-2008
[2926]
Interesting article(s). Somehow I figured I would see a Gregg reply. 
 : )
BrianH
11-Sep-2008
[2927]
Another Brian :)
james_nak
11-Sep-2008
[2928]
I was wondering...
Graham
11-Sep-2008
[2929x2]
Looks like he's using an old version of Rebol where forall does not 
reset to head.
http://hostilefork.com/2008/09/05/the-flexible-series-as-a-core-concept-of-rebol/#more-77
BrianH
11-Sep-2008
[2931]
Fork (as he is known here) should upgrade.
Gregg
12-Sep-2008
[2932x2]
I removed most people from the USA and Pro-USA groups. If you want 
to join them, they are now opt-in, rather than opt-out. Let someone 
know, and you can be added.
This world is hosted by REBOL Technologies, and we are all guests 
here. When you create groups, please consider if they belong on this 
world. This should be mainly a technical world, focusing on REBOL. 
If you create a non-technical group, make it private and allow people 
to opt in.


Social and chat groups are welcome, this is our community after all, 
but please keep the signal-to-noise ratio high. 


If you are abusive or excessivevly confrontational, you may be removed 
from the world.

Happy REBOLing!
BrianH
12-Sep-2008
[2934]
Could you add me back?
Gregg
12-Sep-2008
[2935]
Sorry about that, I missed you in the initial list.
Ashley
12-Sep-2008
[2936]
How do I remove myself from a private group such as "Evolution vs 
Creation"? It comes back with "You must include yourself in this 
group" when I click "Save" (after clicking my name to move it from 
the right-hand list to the left).
BrianH
12-Sep-2008
[2937]
Try going to your user profile and unchecking the associated checkbox.
Gregg
12-Sep-2008
[2938]
I'll remove you. You can bring up your profile and uncheck that group 
as well.
PeterWood
12-Sep-2008
[2939]
Right-click on your name in the users column. The pop-up menu has 
a set of check boxes for the private groups.
Gregg
12-Sep-2008
[2940]
<he he> We're all over this one now.
BrianH
12-Sep-2008
[2941x2]
At least for the private groups you are subscribed to. I think AltME 
could use another level of privacy: opt-in. Then the checklist in 
the user profile could include opt-in groups as unchecked if they 
are not subscribed. It's not privacy, it's peace of mind.
For opt-in groups the current level of privacy is too private.