how to Run an Excel Macro from ASP

W

webuye

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top