Jump to content

Run a EXCEL MACROS


msumesh

Recommended Posts


Hi,

How to run a excel macros, using EXCEL.APPLICATION COM with IIS Server?

If i use EXCEL.SHEET COM object, i am getting error

Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `application': Call was rejected by callee. ' in c:\Inetpub\wwwroot\excel.php:52 Stack trace: #0 c:\Inetpub\wwwroot\excel.php(52): Excel::XL() #1 c:\Inetpub\wwwroot\testing_com.php(22): Excel->XL('Umesh.xls', 'C:\', 'Sheet1') #2 {main} thrown in c:\Inetpub\wwwroot\excel.php on line 52

It works fine in apache server and where as in the IIS server it gives the above error.

Reproduce the code.
<?php
/* Test for Excel.php: A class for use with PHP4 scripts only*/
 
# Put the include file in your php include directory
require ("excel.php");
# Put the umesh.xls file in the document directory
$workbook = "Umesh.xls";
$pathin="C:\\";
$sheet = "Sheet1";

/* Instantiate Excel and open the test file. */

#Instantiate Excel
    $E = new Excel;

#Open the workbook
    $E->XL($workbook,$pathin,$sheet);
    Print "Test starting..<br>";
# Print to browser

# Run the MACRO : Helloworld
$E->runmacro($workbook,"HelloWorldMacro");


# Close the Workbook
$E->closexl();
unset ($E);
?>


Kindly suggest me.. ???


Thanks in advance.



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.