problem with excel

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

    problem with excel

    Hi!

    I looked around here for ole automation with excel, and put this
    togther, which give this error:

    Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwr oot
    \JOTIntranet\Mo dules\changebro wser\excel2.php on line 14 (14= save
    as).

    I have tried a number of thigs, but cannot make this work... and not
    figure out what it is


    <?php
    $excel = new COM("excel.appl ication") or die("unable to instantiate
    MSExcel");

    //Ignore Alerts
    $excel->DisplayAlert s = 0;
    //Make Excel Visible
    $excel->Visible = 1;
    //Create a new workbook
    $WB = $excel->Workbooks->Add;

    $OutputFilename =dirname(__FILE __)."\\test_exc el2.xls"

    $excel->ActiveWorkbo ok->SaveAs("test_e xcel2.xls");

    //Clean up and close, quit, release
    $WB->Close();
    //unset($WS);
    unset($wB);
    $excel->Workbooks->Close();
    $excel->Quit();
    unset($excel);
    ?>

  • Rik

    #2
    Re: problem with excel

    On Fri, 16 Mar 2007 14:52:49 +0100, Sonnich
    <sonnich.jensen @elektrobit.com wrote:
    Hi!
    >
    I looked around here for ole automation with excel, and put this
    togther, which give this error:
    >
    Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwr oot
    \JOTIntranet\Mo dules\changebro wser\excel2.php on line 14 (14= save
    as).
    ([13]) $OutputFilename =dirname(__FILE __)."\\test_exc el2.xls"
    And the line with ';'........
    --
    Rik Wasmus

    Comment

    • Sonnich

      #3
      Re: problem with excel

      On Mar 16, 3:56 pm, Rik <luiheidsgoe... @hotmail.comwro te:
      On Fri, 16 Mar 2007 14:52:49 +0100, Sonnich
      >
      <sonnich.jen... @elektrobit.com wrote:
      Hi!
      >
      I looked around here for ole automation with excel, and put this
      togther, which give this error:
      >
      Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwr oot
      \JOTIntranet\Mo dules\changebro wser\excel2.php on line 14 (14= save
      as).
      ([13]) $OutputFilename =dirname(__FILE __)."\\test_exc el2.xls"
      >
      And the line with ';'........
      I am an idiot. It is Friday. Should go home a have a beer.

      Thanks
      Sonnich

      Comment

      Working...