注册 登录
编程论坛 ASP技术论坛

asp导EXCEL问题

gavinshming 发布于 2008-04-11 16:35, 1672 次点击
asp中设置EXCEL打印格式问题,ActiveSheet.PageSetup为什么不能用?
急!!!!!多谢各位大哥!!
10 回复
#2
gavinshming2008-04-11 16:49
版主救救我啊!1
那位大哥救救我啊!!谢谢!
#3
yms1232008-04-11 17:05
没设置过,楼主用的是Excel2000还是2003或2007?
#4
gavinshming2008-04-11 17:10
EXCEL2000
我用的是Excel2000,vb6.0就可以,asp中不知道为什么不行???
#5
yms1232008-04-11 17:12
楼主想做什么功能?
#6
gavinshming2008-04-11 17:22
在ASP导入EXCEL时,在ASP中用代码设置EXCEL的格式,比如设置为横向,还有页边距之类的.
#7
gavinshming2008-04-11 17:25
With ActiveSheet.PageSetup
        .LeftHeader = ""
        .CenterHeader = ""
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.75)
        .RightMargin = Application.InchesToPoints(0.75)
        .TopMargin = Application.InchesToPoints(1)
        .BottomMargin = Application.InchesToPoints(1)
        .HeaderMargin = Application.InchesToPoints(0.5)
        .FooterMargin = Application.InchesToPoints(0.5)
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = False
        .CenterVertically = False
        .Orientation = xlLandscape
        .Draft = False
        .PaperSize = xlPaperA3
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = 100
    End With
#8
gavinshming2008-04-11 18:55
谁救救我啊!
With ActiveSheet.PageSetup        
        .LeftMargin = Application.InchesToPoints(0.75)
        .RightMargin = Application.InchesToPoints(0.75)
        .TopMargin = Application.InchesToPoints(1)
        .BottomMargin = Application.InchesToPoints(1)
        .HeaderMargin = Application.InchesToPoints(0.5)
        .FooterMargin = Application.InchesToPoints(0.5)
        .Zoom = 100
    End With

以上代码在ASP中怎么不能用!
#9
xinlvchwen862008-05-04 21:36
能不能的清楚点这样让人觉得很模糊
#10
jamesxiaoyao2008-05-05 15:31
直接右键,不就可以导入到EXCEL嘛
#11
yms1232008-05-05 15:34
不过个人记得在ASP中操作Excel时用Microsoft Office Excel涉及Excel界面的操作都是被禁止的。
1