Y
yosh o
I hope this is the right area to post this, and I appoligize if it isn't
in advance.
I've spent the last few days trying to figure out what I'm doing wrong
in this code. What I'm doing is that I'm opening an excel file,
changing the header and then trying to save and close the file. Instead
when I run it, the web page hangs.
Sub Headers()
Dim xlapp ' Our Excel App
Dim wb ' Our Workbook within the Excel App
Dim ws ' Our Worksheet within the Workbook
Set xlapp = Server.CreateObject("Excel.Application")
Set wb = xlapp.Workbooks.open("\\server\path\test.xls")
Set ws = wb.Worksheets(1)
ws.pagesetup.LeftHeader="Some Text"
wb.Save()
Set wb = Nothing
xlapp.Quit
Set xlapp = Nothing
End Sub
in advance.
I've spent the last few days trying to figure out what I'm doing wrong
in this code. What I'm doing is that I'm opening an excel file,
changing the header and then trying to save and close the file. Instead
when I run it, the web page hangs.
Sub Headers()
Dim xlapp ' Our Excel App
Dim wb ' Our Workbook within the Excel App
Dim ws ' Our Worksheet within the Workbook
Set xlapp = Server.CreateObject("Excel.Application")
Set wb = xlapp.Workbooks.open("\\server\path\test.xls")
Set ws = wb.Worksheets(1)
ws.pagesetup.LeftHeader="Some Text"
wb.Save()
Set wb = Nothing
xlapp.Quit
Set xlapp = Nothing
End Sub