Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 7

    Unanswered: Full Excel File from ASP

    I want to Full a excel sheet from a web site using ASP


    if I run this code as .vbs it works

    Code:
    Dim App_Excel 
    Dim App_Sheet 
    Dim Excel_Book 
    
    call OPen_excel_file("C:\Excel\Template.xls","Clients")
    App_Sheet.Range("A1").value ="Done"
    App_Excel.ActiveWorkbook.SaveAs "C:\Excel\Template1.xls" ,true
    Call Quit_Excel
    
    
    Sub Open_Excel_File(FileName , SheetName)
        Set App_Excel = CreateObject("Excel.Application")
        Set Excel_Book = App_Excel.Workbooks.Open(FileName)
        Set App_Sheet = App_Excel.Worksheets.Item(SheetName)
        App_Sheet.Select
        App_Excel.Application.Visible = false
    End Sub
    
    Sub Quit_Excel()
        App_Excel.DisplayAlerts = True
        App_Excel.Application.Quit
        Set App_Excel = Nothing
    End Sub
    User must login via windows Login screen
    let say person1 they get in and can do there work cool
    when they exe the above code and i look in the task manager I can see the execl.exe has been EXE by person1 cool
    but i get a error

    Microsoft Excel error '800a03ec'

    Document not saved.

    /excelit.asp, line 14

    line 14 is the save bit

    person1 has security set to Full Control over only the folder "excel"
    have done the dcomcnfg thing as execl runing ok

    so what am i missing
    its been a long nite

    even a check list on what should turn on/off
    Last edited by myle; 04-14-09 at 20:54.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Are you able to run this code (i.e. is it only person1 that gets the failure)?

    Are you executing this code from ASP or just the VBS file?
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    I'm not sure why you are passing True into the Workbook Object's SaveAs Method FileFormat parameter? It's not a valid argument value.

    Also, to me it looks like you're not releasing your variables properly. I would try VBS code something like this (untested):

    Code:
    Dim App_Excel
    Dim App_Sheet
    Dim Excel_Book
    
    Set App_Excel = CreateObject("Excel.Application")
    Set Excel_Book = App_Excel.Workbooks.Open("C:\Excel\Template.xls")
    Set App_Sheet = Excel_Book.Worksheets.Item("Clients")
    
    App_Sheet.Range("A1").Value = "Done"
    
    App_Excel.DisplayAlerts = False
    Excel_Book.SaveAs "C:\Excel\Template1.xls"
    
    Set App_Sheet = Nothing
    
    Excel_Book.Close False
    Set Excel_Book = Nothing
    
    App_Excel.Quit
    Set App_Excel = Nothing
    Hope that helps...
    Last edited by Colin Legg; 04-15-09 at 14:44.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 7
    what have done did a runas excel under person1
    open the file and manual save it and it did. did everything right also run your code and get the same error
    Microsoft Excel error '800a03ec'

    Document not saved.

    /excelit.asp, line 20

    trying to run the code from ASP
    the vbs was me test to see if I had it right

    was only passing the true because read somewhere that was the replace.
    as it did not error on the vbs i was happy with it. did test that tho
    Last edited by myle; 04-15-09 at 19:59.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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