Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Interfacing PHP and Excel using OLE Automation: file access pr

Hi Joel, thanks for your reply.

Yes, first echo statements work fine, the problem occurs really when opening
the file.

Effectively, I should have been more precise on what "blocked": the script
is still running, but nothing happens.

If I RDP to the console on the server, in the taskmgr I can see the
EXCEL.EXE process created by PHP, and the file it Excel is trying to open is
locked for writing (ie. if I open it by double-clicking, Excel proposes me to
access it read-only).

One interesting thing: I am using the domain integrated authentication in
IIS for this website; if I try to open the locked file by double-clicking it,
Excel tells me the file is locked by MY account, though the EXCEL.EXE process
is run by Console.

There is no firewall on this server.

I might have found the problem: the file I am trying to open has external
links. With a "normal" file it works fine.

That's why I used the second argument (UpdateLinks) in the Open call
documented here (2 means "Never update links for this workbook on opening"):
http://msdn.microsoft.com/en-us/libr...i ce.11).aspx

Apparently, the argument I passed (2 of PHP type integer) is invalid. Let me
explain why I think so:
In the following, I am running everything from http://localhost/test.php,
which allows user interaction.
If I put $excelApp-Visible = 0 and use 2 as the UpdateLinks argument to
Open, everything runs fine without any interaction with the user.
If I put $excelApp-Visible = 1 and use 2 as the UpdateLinks argument to
Open, Excel shows up and tells me the links could not be updated, which means
it tried to update it, which is NOT the expected behaviour!
The values 1, 2 and 3 all give the same result, which is contradictory with
the documentation (1 is "ask", 2 is "do not update" and 3 is "do update").
If I put 0, Excel shows up and closes without any interaction, but 0 is not
an authorised value according to the documentation.
Any other value crashes the script.

According to the documentation, this UpdateLinks argument is an Object,
maybe that's where the problem lies? If so, how can I create the object to be
passed as an argument to Open?

Just out of curiosity, I tried to use the value 0 and run the script from a
client computer, but it is still blocked in the way described above.

Thanks for your help !
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel/Access automation Arly Q. Excel Programming 0 June 7th 07 02:38 PM
Saving an Excel File from Access Automation... Bob Barnes Excel Programming 3 March 2nd 07 04:23 AM
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
Access automation from Excel AccessChallenged Excel Programming 2 December 31st 03 06:29 PM
Automation from .pdb to excel and then to access Kenny chan Excel Programming 1 December 13th 03 01:28 AM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"