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 Autpen()
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 Autpen()
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 Autpen()
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
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 Autpen()
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 Autpen()
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 Autpen()
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