If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Full Excel File from ASP

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-09, 17:39
myle myle is offline
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,110
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
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
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

Last edited by myle; 04-14-09 at 20:54.
Reply With Quote
  #2 (permalink)  
Old 04-15-09, 13:14
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,002
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
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-15-09, 14:37
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 477
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.
Reply With Quote
  #4 (permalink)  
Old 04-15-09, 19:31
myle myle is offline
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,110
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
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
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

Last edited by myle; 04-15-09 at 19:59.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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