Jump to content

Excel UDF


Recommended Posts

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

Link to comment
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.

Link to comment
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.
Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...