+ Reply to Thread
Results 1 to 1 of 1

how to Run an Excel Macro from ASP

Hybrid View

  1. #1
    Registered User
    Join Date
    03-01-2006
    Posts
    1

    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
    Last edited by webuye; 03-01-2006 at 10:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1