>I am working on a web app that uses a COM dll to access VFP data. I would like to have a function in the server to create an Excel file so it can be shipped to various people via email. I've written a sample function as follows just to see if I can start it up and create a worksheet:
>
>function CreateExcelFile
>oExcel = createobject('Excel.Application')
>oExcel.Workbooks.Add
>oBook = oExcel.Workbooks(1)
>oBook.WorkSheets.Add
>oSheet = oBook.Worksheets(1)
>oSheet.range("A1").value = " Sample data "
>
>oExcel.visible = .t.
>endfunc
>
>This produces an error that says access is denied. I assume this has to do with permissions on the server. How would I set this up so it will work?
>
>
>Thanks
Don,
When you call this from a web app, user trying to create excel COM object is internet user (like IUSR_machinename, ASPNET, Network Service).
You could give permission from DCOM (dcomcnfg.exe) however it is a risk IMHO.
Instead you might use OWC.spreadheet (OfficeWebComponents).
Another simplier option is to return back an HTML table or XML or a csv file. Excel can open them all.
Cetin