1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ASP on Excel COM Object

Discussion in 'C#' started by bsilver10, Jul 10, 2006.

  1. #1

    Can anyone help me with my problem? Where developing Project Management Tool with asp and I need to access an Excel File using ASP.

    Set objExcelA = Server.CreateObject("Excel.Application")
    Set objExcelW = objExcelA.Workbooks.Open(Server.MapPath(".") &

    objExcelW.Worksheets(2).Cells(3, 3).Value = "Hey"
    selection.insert shift=xldown

    objExcelW.SaveAs (Server.MapPath(".") & "\benjotest.xls")

    Set objExcelA = nothing

    so far, this is the code i've written, and I have successfully tried this on VB, but the "selection.insert shift=xldown" won't work. I'm trying to select two rows, and insert it in third row. Just like doing "insert copied cells" in excel. I would eally appreciate all the help I could get. Thanks guys!
    bsilver10, Jul 10, 2006 IP
  2. iconico

    iconico Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    The easiest way to figure out how to do this is record a Macro in Excel and then view the VBS that it generates. You should then be able to use it.

    Oh also I would not do this on a prime-time web app, you're going to really load down your web server. Try using a third party component to write the Excel file.
    iconico, Jun 10, 2008 IP