I have created workbooks like this before, but I have never had the following problem. Here is all of my code:
I want to create a new Excel document. The first problem is that the line where it assigns a value to B6 locks up the code. If I take that line out, the page loads fine.
Secondly, before, I have always saved the file then opened it. Shouldn't I be able to see this file without saving it somewhere?
Thanks in advance!
Code:
Set objXlApp = Server.CreateObject("Excel.Application")
objxlapp.visible = true
' open the spreadsheet file
set books = objXlApp.Workbooks.add() 'Open ("\\esp7\OppSite$\template.xls")
' get the worksheet
Set objXlSheet = books.Worksheets("Sheet1")
' read/write from the worksheet
objxlsheet.range("B6").value = "test"
books.Close True
objxlapp.quit
Set objXlApp = Nothing
I want to create a new Excel document. The first problem is that the line where it assigns a value to B6 locks up the code. If I take that line out, the page loads fine.
Secondly, before, I have always saved the file then opened it. Shouldn't I be able to see this file without saving it somewhere?
Thanks in advance!