Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to Run an Excel Macro from ASP
Hi, I'm a newbie to Excel and VB. My question is: I have three online files that I can get their output as text files: -http://DOMAIN.COM/members?list1=sub&export=true&sorted=&query= -http://DOMAIN.COM/members?list2=sub&export=true&sorted=&query= -http://DOMAIN.COM/members?list3=sub&export=true&sorted=&query= With an Excel file that has a macro I can get these files saved automatically to my computer. What I want is to RUN this macro from ASP. I want to click on a link that will call this macro from ASP...receive the text files and save either in Excel or text format to my computer. What should the ASP code be? Here is the macro: Sub Auto_Open() Workbooks.OpenText Filename:= _ "http://DOMAIN.COM/members?list1=sub&export=true&sorted=&query=" _ , Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier _ :=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:= _ False, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array( _ 1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, _ 1), Array(9, 1)), TrailingMinusNumbers:=True ActiveWorkbook.SaveAs Filename:="C:\File1-" & Day(Date) & "-" & Month(Date) & "-" & Year(Date) & ".xls", FileFormat:= _ xlNormal End Sub Sub Auto_Open() Workbooks.OpenText Filename:= _ "http://DOMAIN.COM/members?list2=sub&export=true&sorted=&query=" _ , Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier _ :=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:= _ False, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array( _ 1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, _ 1), Array(9, 1)), TrailingMinusNumbers:=True ActiveWorkbook.SaveAs Filename:="C:\File2-" & Day(Date) & "-" & Month(Date) & "-" & Year(Date) & ".xls", FileFormat:= _ xlNormal End Sub Sub Auto_Open() Workbooks.OpenText Filename:= _ "http://DOMAIN.COM/members?list3=sub&export=true&sorted=&query=" _ , Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier _ :=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:= _ False, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array( _ 1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, _ 1), Array(9, 1)), TrailingMinusNumbers:=True ActiveWorkbook.SaveAs Filename:="C:\File3-" & Day(Date) & "-" & Month(Date) & "-" & Year(Date) & ".xls", FileFormat:= _ xlNormal End Sub -- webuye ------------------------------------------------------------------------ webuye's Profile: http://www.excelforum.com/member.php...o&userid=32058 View this thread: http://www.excelforum.com/showthread...hreadid=518090 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
translate lotus 1-2-3 macro into excel macro using excel 2000 | Excel Programming | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming |