Opening Excel file takes too long

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinci
    New Member
    • Aug 2006
    • 62

    Opening Excel file takes too long

    hi everyone!

    here's my code

    Code:
        oExcel.Visible = False : oExcel.DisplayAlerts = False 
      
        'Start a new workbook 
        oBooks = oExcel.Workbooks 
    
    
    'Load template with chart -> this line is where the process takes time
        oBooks.Open(Server.MapPath(Request.ApplicationPath) & "\MyTemplate.xls")
    
    
         oBook = oBooks.Item(1) 
        oSheets = oBook.Worksheets 
        oSheet = CType(oSheets.Item(1), Excel.Worksheet) 
        oSheet.Name = "First Sheet" 
        oCells = oSheet.Cells
    as u can see, i commented on where the process takes time..
    why is it? any idea on how to fix this or is it just my pc that is slow(i guess not)...

    any suggestions is highly appreciated!

    tnx in advance!

    vinci
  • rupesh11
    New Member
    • Aug 2007
    • 1

    #2
    oBooks.Open("pa th of your file")
    This will help ?

    Originally posted by vinci
    hi everyone!

    here's my code

    Code:
        oExcel.Visible = False : oExcel.DisplayAlerts = False 
      
        'Start a new workbook 
        oBooks = oExcel.Workbooks 
    
    
    'Load template with chart -> this line is where the process takes time
        oBooks.Open(Server.MapPath(Request.ApplicationPath) & "\MyTemplate.xls")
    
    
         oBook = oBooks.Item(1) 
        oSheets = oBook.Worksheets 
        oSheet = CType(oSheets.Item(1), Excel.Worksheet) 
        oSheet.Name = "First Sheet" 
        oCells = oSheet.Cells
    as u can see, i commented on where the process takes time..
    why is it? any idea on how to fix this or is it just my pc that is slow(i guess not)...

    any suggestions is highly appreciated!

    tnx in advance!

    vinci

    Comment

    Working...