[PHP] COM and php.... Several issues....

2002-03-06 Thread jeremy spielmann

I've read through most of the documentation on how to use COM to create MS Word 
documents via PHP, but I'm still having some issues that I can't seem to find any help 
on. 

CODE: 
? 
$word=new COM(word.application) or die(Cannot start MS Word); 
print Loaded word version ($word-Version)\n; 
$word-visible = 1 ; 
$word-Documents-Add(); 
$word-Selection-Typetext(This is a test); 
? 

RETURNS: 
Loaded word version (9.0) 
Warning: Invoke() failed: Exception occurred. Source: Microsoft Word Description: 
Could not open macro storage. in C:\Inetpub\wwwroot\php\word.php on line 6 

I've looked on MS's website and have adjusted the DCOMCNFG.cfg as below: 
1. Microsoft Word Document 
2. Default Access Permission (INTERACTIVE / IUSR_NT-BOX) 
2.Default Launch Permissions (INTERACTIVE / IUSR_NT-BOX) 
3. Default Config. Permissions (INTERACITVE /IUSR_NT-BOX) 

I really don't know what else I'm doing wrong...I've been trying to get this to work 
for the last two days and it seems like and endless loop!! 

Any help would be appreciated.. 

Jeremy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] COM in PHP

2001-05-12 Thread ws

Hi,

here my problem with COM in PHP.


?
echo J-Server in der dynamischen PHP-Web-Site. brbr;

$jServer = new COM(jexeserver) or DIE (Connect zum J Server ist nicht
möglich);
$jServer-Show(1);
$jServer-Log(1);

$jServer-Do(0!:0 (1!:40''),'system\extras\config\profile.ijs');
$jServer-Do(load'd:\\j_tm1dll\\j\\tm1api.ijs');
$jServer-Do(load'd:\\j_tm1dll\\j\\tm1con.ijs');
$jServer-Do(load'd:\\j_tm1dll\\j\\tm1prop.ijs');
$jServer-Do(load'd:\\j_tm1dll\\j\\tm1view.ijs');

$jServer-Do(Tm1On'');
$jServer-Do(Tm1AdmSet'OLAPLINE01');
$jServer-Do(SrvCon'zeiterf';'Admin';'');

#$jServer-Do(NN=:'XXX');

$Var = xxx;
$jServer-SetB(NN, $Var);  //  In the COM server: NN = $Var
$jServer-Do(NN);  //  Display NN in the COM server
$jServer-Do(NN=:'yyy'); //  In the COM server: NN = yyy

$jServer-GetB(NN, $Var);//  ===   There is my problem:  ( is a 
refernce)
   //  In the COM server $Var = NN
echo $Var;   //  echo $Var Output: xxx and not yyy ?!?

$jServer-Quit();

?

Is there a bug in my code or is this a bug in COM ???

Wolf Schoemann
[EMAIL PROTECTED]




Re: [PHP] Revised [PHP] COM and PHP

2001-02-28 Thread Daniel Tryba

On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote:
 I have been trying the following example from the PHP developer's cookbook
 and it keeps giving me the following error.
 
 Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
 ? //line 1
 $excel_handle = new COM("excel.application"); //line2
 $excel_handle-Visible = false; //line3
 $worksheet = $excel_handle-workbooks-add(); //line4
 $worksheet-Cells(1,1)-value = "Name"; //line5
 $worksheet-SaveAs("temp.xls"); //line6
 $excel_handle-quit(); //line7
 //line8
 ? //line9
 
 Anyone that has Com and PHP experience help please

I didn't test it in PHP (only in wscript.exe), but it seems the example 
is wrong. It should be (line 4 - 4a, 4b):

excel_handle = new COM("Excel.Application"); //line2
excel_handle.Visible = true; //line3
workbook = excel_handle.Workbooks.Add(); //4a
worksheet=workbook.WorkSheets.Add(); //4b
worksheet.Cells(1,1).Value = "Name"; //line5
worksheet.SaveAs("temp.xls"); //line6
excel_handle.quit(); //line7

This seems to work.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-WIN] Re: [PHP] Revised [PHP] COM and PHP

2001-02-28 Thread Alain Samoun

Among other articles, look at the COM functions in PHP4 article:
http://www.phpbuilder.com/columns/

Alain

On Wed, Feb 28, 2001 at 11:35:15AM +0100, Daniel Tryba wrote:
 On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote:
  I have been trying the following example from the PHP developer's cookbook
  and it keeps giving me the following error.
  
  Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
  ? //line 1
  $excel_handle = new COM("excel.application"); //line2
  $excel_handle-Visible = false; //line3
  $worksheet = $excel_handle-workbooks-add(); //line4
  $worksheet-Cells(1,1)-value = "Name"; //line5
  $worksheet-SaveAs("temp.xls"); //line6
  $excel_handle-quit(); //line7
  //line8
  ? //line9
  
  Anyone that has Com and PHP experience help please
 
 I didn't test it in PHP (only in wscript.exe), but it seems the example 
 is wrong. It should be (line 4 - 4a, 4b):
 
 excel_handle = new COM("Excel.Application"); //line2
 excel_handle.Visible = true; //line3
 workbook = excel_handle.Workbooks.Add(); //4a
 worksheet=workbook.WorkSheets.Add(); //4b
 worksheet.Cells(1,1).Value = "Name"; //line5
 worksheet.SaveAs("temp.xls"); //line6
 excel_handle.quit(); //line7
 
 This seems to work.
 
 
 -- 
 PHP Windows Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] COM and PHP

2001-02-05 Thread Conover, Ryan

I have been trying the following example from the PHP developer's cookbook
and it keeps giving me the following error.

Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 4
? //line 1
$excel_handle = new COM("excel.application"); //line2
$excel_handle-Visible = false; //line3
$worksheet-Cells(1,1)-value = "Name"; //line4
$worksheet-SaveAs("temp.xls"); //line5
$excel_handle-quit(); //line6
//line7
? //line8

Anyone that has Com and PHP experience help please

Ryan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Revised [PHP] COM and PHP

2001-02-05 Thread Conover, Ryan






I have been trying the following example from the PHP developer's cookbook
and it keeps giving me the following error.

Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
? //line 1
$excel_handle = new COM("excel.application"); //line2
$excel_handle-Visible = false; //line3
$worksheet = $excel_handle-workbooks-add(); //line4
$worksheet-Cells(1,1)-value = "Name"; //line5
$worksheet-SaveAs("temp.xls"); //line6
$excel_handle-quit(); //line7
//line8
? //line9

Anyone that has Com and PHP experience help please

Ryan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] RE: [PHP-WIN] Revised [PHP] COM and PHP

2001-02-05 Thread Sterling Hughes


 I tried with FALSE same error.

 I also tried the following word example

 ?
 $word = new COM("word.application") or die("Unable to instanciate Word");
 print "Loaded Word, version {$word-Version}\n";
 $word-Visible = 0;
 $word-Documents-Add();
 $word-Selection-TypeText("Testing, testing... 1,2,3");
 $word-Documents[1]-SaveAs("Some.doc");
 $word-Quit();
 ?

 I get the following error

 Loaded Word, version 9.0
 Warning: Invoke() failed: No description available in
 c:\Inetpub\wwwroot/temp2.php on line 5

 Warning: Invoke() failed: Exception occurred. in
 c:\Inetpub\wwwroot/temp2.php on line 7


That means that you don't have the com component installed on your machine
correctly...




  I have been trying the following example from the PHP developer's
cookbook
  and it keeps giving me the following error.

  Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
  ? file://line 1
  $excel_handle = new COM("excel.application"); file://line2
 $excel_handle-Visible = false; file://line3
  $worksheet = $excel_handle-workbooks-add(); file://line4
 $worksheet-Cells(1,1)-value = "Name"; file://line5

This should be:

$cell = $worksheet-Cells(1, 1);
$cell-value = 1;

And it should work..



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PHP-WIN] Revised [PHP] COM and PHP

2001-02-05 Thread Conover, Ryan

I tried with FALSE same error.

I also tried the following word example

?
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word-Version}\n";
$word-Visible = 0;
$word-Documents-Add();
$word-Selection-TypeText("Testing, testing... 1,2,3");
$word-Documents[1]-SaveAs("Some.doc");
$word-Quit();
?

I get the following error

Loaded Word, version 9.0 
Warning: Invoke() failed: No description available in
c:\Inetpub\wwwroot/temp2.php on line 5

Warning: Invoke() failed: Exception occurred. in
c:\Inetpub\wwwroot/temp2.php on line 7

Ryan


-Original Message-
From: Andris Jancevskis [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 3:01 PM
To: Conover, Ryan
Subject: Re: [PHP-WIN] Revised [PHP] COM and PHP


Try "FALSE" instead of "false"

Andris
mailto:[EMAIL PROTECTED]

+---
Monday, February 05, 2001, 10:05:24 PM, you wrote:






 I have been trying the following example from the PHP developer's cookbook
 and it keeps giving me the following error.

 Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
 ? //line 1
 $excel_handle = new COM("excel.application"); //line2
$excel_handle-Visible = false; //line3
 $worksheet = $excel_handle-workbooks-add(); //line4
$worksheet-Cells(1,1)-value = "Name"; //line5
$worksheet-SaveAs("temp.xls"); //line6
$excel_handle-quit(); //line7
 //line8
? //line9

 Anyone that has Com and PHP experience help please

 Ryan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]