ASP控制Excel文档的页面设置
我用这段VBA代码在Excel没有问题,但是在ASP里就不行总是500错误,有人能帮我吗?
'创建excel应用对象
set objExcelApp = CreateObject("Excel.Application")
'新建工作簿
objExcelApp.WorkBooks.add
set objExcelBook = objExcelApp.ActiveWorkBook
'激活工作区域Sheet1为objExcelSheet
set objExcelSheet=objExcelBook.Worksheets("Sheet1")
'============================================================
'上面的都没有问题,这以下的没有一句能执行!!!!!!!!!
With objExcelSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
objExcelSheet.PageSetup.PrintArea = ""
With objExcelSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
'左右上下边距2.5
.LeftMargin = Application.InchesToPoints(0.984251968503937)
.RightMargin = Application.InchesToPoints(0.984251968503937)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
'页眉页脚1.3
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = -4142
.PrintQuality = 360
.CenterHorizontally = False
.CenterVertically = False
.Orientation = 1
.Draft = False
.PaperSize = 8
.FirstPageNumber = -4105
.Order = 1
.BlackAndWhite = False
.Zoom = 100
End With
快帮帮我吧,都几天没弄出来了