How to do selection.subtotal in VBScript/ASP ?
I need to run subtotals on an excel sheet from an ASP
page. I'm able to create the page and populate it with data, but I can not figure out how to subtotal. When I created a macro, the VB line was the following: Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(10, 12, 13 _ ), Replace:=True, PageBreaks:=False, SummaryBelowData:=True This line creates an error in the ASP page, and I read that I should remove the names and := suymbols. This gave me the following line: ..Selection.Subtotal 5, xlSum, Array(10, 12, 13, 16, 18, 21, 24, 27), True, False, True This line does not create an error, but it doesn't subtotal either, it just cuases the browser to hang. I read how to do this in Fox Pro, so I assume their is a way to handle it in VB Script. Thanks! |
How to do selection.subtotal in VBScript/ASP ?
Try replacing xlSum with its value -4157
-- Regards, Tom Ogilvy "Wes" wrote in message ... I need to run subtotals on an excel sheet from an ASP page. I'm able to create the page and populate it with data, but I can not figure out how to subtotal. When I created a macro, the VB line was the following: Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(10, 12, 13 _ ), Replace:=True, PageBreaks:=False, SummaryBelowData:=True This line creates an error in the ASP page, and I read that I should remove the names and := suymbols. This gave me the following line: .Selection.Subtotal 5, xlSum, Array(10, 12, 13, 16, 18, 21, 24, 27), True, False, True This line does not create an error, but it doesn't subtotal either, it just cuases the browser to hang. I read how to do this in Fox Pro, so I assume their is a way to handle it in VB Script. Thanks! |
How to do selection.subtotal in VBScript/ASP ?
Already tried that, same result. Thanks for the reply
tho! I'm also having trouble setting the printer orientation. Is their a good website for excel automation through asp? -----Original Message----- Try replacing xlSum with its value -4157 -- Regards, Tom Ogilvy "Wes" wrote in message ... I need to run subtotals on an excel sheet from an ASP page. I'm able to create the page and populate it with data, but I can not figure out how to subtotal. When I created a macro, the VB line was the following: Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(10, 12, 13 _ ), Replace:=True, PageBreaks:=False, SummaryBelowData:=True This line creates an error in the ASP page, and I read that I should remove the names and := suymbols. This gave me the following line: .Selection.Subtotal 5, xlSum, Array(10, 12, 13, 16, 18, 21, 24, 27), True, False, True This line does not create an error, but it doesn't subtotal either, it just cuases the browser to hang. I read how to do this in Fox Pro, so I assume their is a way to handle it in VB Script. Thanks! . |
How to do selection.subtotal in VBScript/ASP ?
I don't know anything about asp, but my understanding is that you use
automation from ASP (through vbscript) same as you would from VB or word or access or vbscript itself (as examples). If so: http://support.microsoft.com/?id=167223 Microsoft Office 97 Automation Help File Available on MSL http://support.microsoft.com/support...aqVBOffice.asp Frequently Asked Questions about Microsoft Office Automation Using Visual Basic http://support.microsoft.com/support...fdevinapps.asp Programming Office from Within Office http://support.microsoft.com/support...dev/iisfaq.asp Integrating Office with IIS FAQ http://support.microsoft.com/?id=219151 Q219151 - HOWTO: Automate Excel 97 and Excel 2000 from Visual Basic http://support.microsoft.com/support...automation.asp Using Automation with Microsoft Excel 97 http://support.microsoft.com/?id=234774 HOWTO: Automate Excel from an HTML Web Page Using JScript http://support.microsoft.com/?id=198703 HOWTO: Automating Excel From Client-Side VBScript -- But both of your problems sound like they could stem from using xlconstants that are undefined at runtime. xlsum appears to have a value of zero since you don't have a reference to the xl object library where the constant is defined. However, if you have tried hard coding the constant and are using positional arguments and it still doesn't work, then I can't say. -- Regards, Tom Ogilvy wrote in message ... Already tried that, same result. Thanks for the reply tho! I'm also having trouble setting the printer orientation. Is their a good website for excel automation through asp? -----Original Message----- Try replacing xlSum with its value -4157 -- Regards, Tom Ogilvy "Wes" wrote in message ... I need to run subtotals on an excel sheet from an ASP page. I'm able to create the page and populate it with data, but I can not figure out how to subtotal. When I created a macro, the VB line was the following: Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(10, 12, 13 _ ), Replace:=True, PageBreaks:=False, SummaryBelowData:=True This line creates an error in the ASP page, and I read that I should remove the names and := suymbols. This gave me the following line: .Selection.Subtotal 5, xlSum, Array(10, 12, 13, 16, 18, 21, 24, 27), True, False, True This line does not create an error, but it doesn't subtotal either, it just cuases the browser to hang. I read how to do this in Fox Pro, so I assume their is a way to handle it in VB Script. Thanks! . |
All times are GMT +1. The time now is 03:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com