ASP and excel help
- Started
- Last post
- 7 Responses
- georgietexan
Anyone ever have an asp form feed in an excel sheet? know of a good web tutorial site? I need to put something togather for work to help me speed up my day.
- mitsu0
yup, just use the following code:
Set objXls = CreateObject("Excel.Application...
objXls.Workbooks.Open mypath
Set objSheet = objXls.Worksheets(1)
objSheet.Cells(1, 1).Value = "hello"
objXls.ActiveWorkbook.Save
Set objSheet = Nothing
objXls.ActiveWorkbook.Close
objXls.Quit
Set objXls = Nothing
- georgietexan0
cool but what if the file is all ready set up with data and everything pivot tables. At this point can I just feed into this form?
- mitsu0
wait, are you pulling data from excel and writing to a database or pulling from an asp form and writing it to excel?
- georgietexan0
pulling from an asp form and writing it to excel.
Yeah have the Excel sheet all set up at this piont, in fact I'm just tring to save myself some time by just filling the asp form out and sending that data to excel sheet. I have done this with access (form feed to access) but never with excel thats why I'm asking.
- mitsu0
ok, then the code i showed you will do the job.
- georgietexan0
how does that string of code know where to put the data? what if I have data in cell A1 how will the script know not to delete that data but go to the next cell A2?
- mitsu0
well, the code is referencing a particular cell, so just check the value in it before writing to it...
if there's something in there, just increment the row and repeat the process. a recursive function will do this for you.