Creating of file

Results 1 to 2 of 2

Thread: Creating of file

  1. #1
    Join Date
    Dec 1969

    Default Creating of file

    I am trying to run a script with codes as follows in the IIS Server<BR><BR>Set aObj= CreateObject("Excel.Application")<BR>Set xlbook= aObj.Workbooks.add(filepath)<BR><BR>When i run it, a blank screen appears..<BR>it should not be as the file to be opened do contains text...<BR>when i checked the task manager, the excel.exe is created..<BR><BR>what is wrong???<BR>is running the script in IIS different in PWS..<BR>reallly need it urgently...<BR><BR>thanx<BR><BR><BR><BR>

  2. #2
    Mike Conrath Guest

    Default RE: Creating of file

    If you are trying to create a NEW Excel spreadsheet the following should work. You cannot create an instance of Excel on PWS because it does not allow out of process components. (Or so I&#039m told)<BR><BR>&#039Create an instance of Excel<BR>Dim xlWorkSheet<BR>Dim xlApplication<BR>Set xlApplication = Server.CreateObject("Excel.Application")<BR>xlAppl ication.Visible = False<BR>xlApplication.Workbooks.Add<BR>Set xlWorksheet = xlApplication.Worksheets(1)<BR>&#039Create body of Excel document here<BR>&#060;!--EXCEL BODY CODE --&#062;<BR>&#039Save file and close Excel<BR>xlWorkSheet.SaveAs Server.MapPath(".") & "Excel est.xls"<BR>xlApplication.Quit<BR><BR>Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts