cannot load excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kirke

    cannot load excel

    Hi, I want to load excel.
    However, this simple code doesn't work. When I open this page, there's
    nothign happen, not even 'unable to initiate excel" or othere error
    message.
    I have excel in server. Do you know why it doesn't work? Should I make
    some special setting?
    Thx.


    <?php

    $ex = new COM("excel.appl ication") or die("Unable to instantiate
    excel");
    echo "Loaded Word, version {$ex->Version} \n";

    ?>

  • Tim Roberts

    #2
    Re: cannot load excel

    "kirke" <hinkyeol@gmail .comwrote:
    >
    >Hi, I want to load excel.
    >However, this simple code doesn't work. When I open this page, there's
    >nothign happen, not even 'unable to initiate excel" or othere error
    >message.
    >I have excel in server. Do you know why it doesn't work? Should I make
    >some special setting?
    If that's all there is, then it's probably working fine. Instantiating
    Excel as a COM object does not automatically make it visible. You might
    try:
    $ex = new COM("excel.appl ication");
    $ex->Visible = 1;
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.

    Comment

    • kirke

      #3
      Re: cannot load excel

      aha- i'll try it. Thx.

      Tim Roberts wrote:
      "kirke" <hinkyeol@gmail .comwrote:

      Hi, I want to load excel.
      However, this simple code doesn't work. When I open this page, there's
      nothign happen, not even 'unable to initiate excel" or othere error
      message.
      I have excel in server. Do you know why it doesn't work? Should I make
      some special setting?
      >
      If that's all there is, then it's probably working fine. Instantiating
      Excel as a COM object does not automatically make it visible. You might
      try:
      $ex = new COM("excel.appl ication");
      $ex->Visible = 1;
      --
      Tim Roberts, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      • kirke

        #4
        Re: cannot load excel

        I forgot one thing.
        If I write code like following :

        print "before";
        $ex = new COM("excel.appl ication");
        print "after" ;

        only "before" is printed.
        Isn't it bad sign?


        kirke wrote:
        aha- i'll try it. Thx.
        >
        Tim Roberts wrote:
        "kirke" <hinkyeol@gmail .comwrote:
        >
        >Hi, I want to load excel.
        >However, this simple code doesn't work. When I open this page, there's
        >nothign happen, not even 'unable to initiate excel" or othere error
        >message.
        >I have excel in server. Do you know why it doesn't work? Should I make
        >some special setting?
        If that's all there is, then it's probably working fine. Instantiating
        Excel as a COM object does not automatically make it visible. You might
        try:
        $ex = new COM("excel.appl ication");
        $ex->Visible = 1;
        --
        Tim Roberts, timr@probo.com
        Providenza & Boekelheide, Inc.

        Comment

        • Tim Roberts

          #5
          Re: cannot load excel

          "kirke" <hinkyeol@gmail .comwrote:
          >I forgot one thing.
          >If I write code like following :
          >
          >print "before";
          >$ex = new COM("excel.appl ication");
          >print "after" ;
          >
          >only "before" is printed.
          >Isn't it bad sign?
          Could be. I'm not convinced that a service (Apache) is allowed to launch
          an interactive application (Excel). What do you need Excel to do for you?
          --
          Tim Roberts, timr@probo.com
          Providenza & Boekelheide, Inc.

          Comment

          • kirke

            #6
            Re: cannot load excel

            what i want to do is dump the data into excel and run it(macro) and
            save the file.

            Tim Roberts wrote:
            "kirke" <hinkyeol@gmail .comwrote:
            >
            I forgot one thing.
            If I write code like following :

            print "before";
            $ex = new COM("excel.appl ication");
            print "after" ;

            only "before" is printed.
            Isn't it bad sign?
            >
            Could be. I'm not convinced that a service (Apache) is allowed to launch
            an interactive application (Excel). What do you need Excel to do for you?
            --
            Tim Roberts, timr@probo.com
            Providenza & Boekelheide, Inc.

            Comment

            • Tim Roberts

              #7
              Re: cannot load excel

              "kirke" <hinkyeol@gmail .comwrote:
              >
              >what i want to do is dump the data into excel and run it(macro) and
              >save the file.
              Well, as I said, I'm not convinced this is possible. Perhaps you can do
              the computations yourself and write it out as a comma-separated file, which
              can be opened in Excel just fine.
              --
              Tim Roberts, timr@probo.com
              Providenza & Boekelheide, Inc.

              Comment

              Working...