Multiple Excel Files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anne

    #1

    Multiple Excel Files

    hie, in my web application, i have a dropdownlist, and a
    button. i want to be able to select from the list, and
    whatever item that i have selected, i want to use the item
    value for manipulation. once i have selected from the
    list, the button is clicked and the application will
    display an excel file. for example, i chose number 8 in my
    dropdownlist, and the application will display the excel
    file with the number 8. i also need to use the item
    selected to search for my excel files. How can i code this
    function? i've tried coding it as below, but got an error
    when i tried to append the item selected to a string
    (strExcel). what can i do to make my program works as i
    want it to? anybody got an idea on how to solve this?
    thanx!

    Private Sub btnOK_Click(ByV al sender As System.Object,
    ByVal e As System.EventArg s) Handles btnOK.Click
    Dim WW As New ListItem()
    WW = wwList.Selected Item()

    strMyPath = "C:\Inetpub\www root\Final_MR"

    If fso.FolderExist s(strMyPath) Then
    fso.GetFolder(s trMyPath)
    For Each sFl In fso.GetFolder(s trMyPath).Files
    If sFl.Name Like ".xls" Then
    strtmp = fso.GetFileName (sFl.Name)
    intlngth = Len(strtmp) - 5
    strName = Microsoft.Visua lBasic.Left
    (strtmp, intlngth)
    strExcel = strName & WW & ".xls"
    End If
    Next
    Response.Redire ct
    ("C:\Inetpub\ww wroot\Final_MR\ " & strExcel)
    End If
    End Sub

  • Anne

    #2
    Multiple Excel Files


    it's ok..i got it 2 work like i wanted. thanx anyway...
    [color=blue]
    >-----Original Message-----
    >hie, in my web application, i have a dropdownlist, and a
    >button. i want to be able to select from the list, and
    >whatever item that i have selected, i want to use the[/color]
    item[color=blue]
    >value for manipulation. once i have selected from the
    >list, the button is clicked and the application will
    >display an excel file. for example, i chose number 8 in[/color]
    my[color=blue]
    >dropdownlist , and the application will display the excel
    >file with the number 8. i also need to use the item
    >selected to search for my excel files. How can i code[/color]
    this[color=blue]
    >function? i've tried coding it as below, but got an error
    >when i tried to append the item selected to a string
    >(strExcel). what can i do to make my program works as i
    >want it to? anybody got an idea on how to solve this?
    >thanx!
    >
    >Private Sub btnOK_Click(ByV al sender As System.Object,
    >ByVal e As System.EventArg s) Handles btnOK.Click
    > Dim WW As New ListItem()
    > WW = wwList.Selected Item()
    >
    > strMyPath = "C:\Inetpub\www root\Final_MR"
    >
    > If fso.FolderExist s(strMyPath) Then
    > fso.GetFolder(s trMyPath)
    > For Each sFl In fso.GetFolder(s trMyPath).Files
    > If sFl.Name Like ".xls" Then
    > strtmp = fso.GetFileName (sFl.Name)
    > intlngth = Len(strtmp) - 5
    > strName = Microsoft.Visua lBasic.Left
    >(strtmp, intlngth)
    > strExcel = strName & WW & ".xls"
    > End If
    > Next
    > Response.Redire ct
    >("C:\Inetpub\w wwroot\Final_MR \" & strExcel)
    > End If
    >End Sub
    >
    >.
    >[/color]

    Comment

    • Anne

      #3
      Multiple Excel Files


      it's ok..i got it 2 work like i wanted. thanx anyway...
      [color=blue]
      >-----Original Message-----
      >hie, in my web application, i have a dropdownlist, and a
      >button. i want to be able to select from the list, and
      >whatever item that i have selected, i want to use the[/color]
      item[color=blue]
      >value for manipulation. once i have selected from the
      >list, the button is clicked and the application will
      >display an excel file. for example, i chose number 8 in[/color]
      my[color=blue]
      >dropdownlist , and the application will display the excel
      >file with the number 8. i also need to use the item
      >selected to search for my excel files. How can i code[/color]
      this[color=blue]
      >function? i've tried coding it as below, but got an error
      >when i tried to append the item selected to a string
      >(strExcel). what can i do to make my program works as i
      >want it to? anybody got an idea on how to solve this?
      >thanx!
      >
      >Private Sub btnOK_Click(ByV al sender As System.Object,
      >ByVal e As System.EventArg s) Handles btnOK.Click
      > Dim WW As New ListItem()
      > WW = wwList.Selected Item()
      >
      > strMyPath = "C:\Inetpub\www root\Final_MR"
      >
      > If fso.FolderExist s(strMyPath) Then
      > fso.GetFolder(s trMyPath)
      > For Each sFl In fso.GetFolder(s trMyPath).Files
      > If sFl.Name Like ".xls" Then
      > strtmp = fso.GetFileName (sFl.Name)
      > intlngth = Len(strtmp) - 5
      > strName = Microsoft.Visua lBasic.Left
      >(strtmp, intlngth)
      > strExcel = strName & WW & ".xls"
      > End If
      > Next
      > Response.Redire ct
      >("C:\Inetpub\w wwroot\Final_MR \" & strExcel)
      > End If
      >End Sub
      >
      >.
      >[/color]

      Comment

      Working...