Is this a bug in PHP
| From: | David Richards | Date: | Tue, 05 Aug 2003 14:01:59 +0000 |
| Subject: | Is this a bug in PHP | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21024@lists.php.net to get a copy of this message | ||
Hi,
Can anyone tell me if the following is a bug in php or a coding error on my
part. When I run the following piece of code I get an error:
Code:
$empty = new VARIANT();
$word = new COM("word.application") or die("Unable to instantiate Word");
$word->Visible = 1;
$word->Documents->Add();
$word->ActiveDocument->MailMerge->MainDocumentType = wdFormLetters;
$word->ActiveDocument->MailMerge->OpenDataSource
("c:\\temp\\test.xls",$empty,$empty,$empty,$empty,$empty,$empty,$empty,$empt
y,$empty,$empty,$empty,"SELECT * FROM test$",$empty,$empty,$empty);
Error:
Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in
c:\program files\apache group\apache\htdocs\test6.php on line 93
I didn't think I had specified 17 arguments in the call to OpenDataSource.
I have checked what data types OpenDataSource is expecting and according to
OLE/COM viewer, it is expecting a BSTR followed by 15 optional variants.
If someone could let me know if its me before I report it as a bug that
would be good.
Thanks in advance
Dave