in reply to Win32::OLE excel application macro execution

This usually comes down to a permissions issue. Usually the user/system account your webserver and your script run as so not have the privileges to launch Excel, connect to OLE objects or read from arbitrary files or directories. You will have to consult with your server administrator how to best remedy this situation
  • Comment on Re: Win32::OLE excel application macro execution

Replies are listed 'Best First'.
Re^2: Win32::OLE excel application macro execution
by suzun30 (Acolyte) on Apr 15, 2013 at 21:38 UTC
    Hi , Thanks for the response. Would it not return a access denied error in that case? I am a part of the admin on this server and I am running the webpage with my userid logged in via sspi auth. So would it not give access to the files and folders per my authentication ? Kindly advise. Thanks,

      Hi,

      Corion is correct, this usually comes down to permissions.

      Try printing out the perms for all the files etc., you are accessing. And print the whole %ENV and anything else that comes to mind.

      The problem will probably be in the differences. Well it's a starting point. Get these out of the way and if it's still not working, come back with more details.

      J.C.

        Thanks for the inputs. I also was able to get the error using Win32::OLE->LastError() and this is what it shows.

        Microsoft Excel cannot access the file 'C:\test.xlsm'. There are sever +al possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently + open workbook. Win32::OLE(0.1709) error 0x800a03ec in METHOD/PROPERTYGET "Open"

        The users on this server have permissions to read and execute files and folders from what I can see on the properties of the file I am trying to read from. I did print out the Env variables like suggested, but apart from the remote_user variable which is set to the currently logged in user ,who does have privileges to read and execute, nothing seems to be of any use. I found this thread which seems to talk about the same issue, but have not found a solution yet. http://www.perlmonks.org/bare/?node_id=477477

        Few other sites for the same issue, the user had to change the format of file path, which I have already tried to no avail. Please help.

        I also verified if I am able to read the file by opening it using file handle and it opens fine. Also , I have written and read files from this location from my webpage previously. Is it because this is being done via win32::OLE that it is requiring some more authentication? Appreciate any pointers