Sign in to follow this  
Followers 0
mattw112

Excel UDF

6 posts in this topic

I'm trying to use the Excel UDF found here:

http://www.autoitscript.com/forum/index.ph...st&p=249975

I've got the code working on my machine but when I run it on a server it fails.

My guess is that it fails because the server does not have excel installed.

Is there any other way to read a excel worksheet and use the data in it if excel is not installed on the machine itself?

Thanks,

Terry

Share this post


Link to post
Share on other sites

If you cannot directly work with data in Excel, then another option would be to extract the data to a csv. Of course if you need to modify, rather than simply look at the data, then you will need Excel or some other way to affect the .xls file. You can extract the data from excel to csv in a couple way, including perl or vb.

Share this post


Link to post
Share on other sites

You can use ObjCreate to open COM objects on remote computers. Something like this:

$oExcel = ObjCreate("Excel.Application", "Computer", "username", "password")
With $oExcel
    .Visible = False
    .WorkBooks.Open("X:\files\test.xls", Default, True)
    .ActiveWorkbook.Sheets(1).Select()
EndWith

MsgBox(0, "Cell A1", "A1 = " & $oExcel.Activesheet.Cells(1, 1).Value)

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

ok thanks, I've already made a new version which basically gets everything from a text file. I was hoping to use the xls since they were already made but I basically exported the xls to tab seperated .txt files instead. Then I do a readline on each line and if the computer name I'm looking for is found it gets the whole line and breaks it apart at the TABs into an array that I can use.

Thanks,

Terry

Share this post


Link to post
Share on other sites

ok thanks, I've already made a new version which basically gets everything from a text file. I was hoping to use the xls since they were already made but I basically exported the xls to tab seperated .txt files instead. Then I do a readline on each line and if the computer name I'm looking for is found it gets the whole line and breaks it apart at the TABs into an array that I can use.

Thanks,

Terry

Hi, Does copying the excel file to local machine temp file [and use that] not work anyway?

Best, randall

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Not sure I understand what you mean? The local machine does not have Excel so the excel com calls dont work.

But like I said I'm using text files now instead of excel and that works fine for getting the info I need at runtime.

I was kind of curious though about using ADO instead of COM to interact with Excel? Anyone doing that? That should allow people to do stuff with Excel when Excel is not installed.

Terry

Edited by mattw112

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0