473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Opening Excel file takes too long

vinci
62
hi everyone!

here's my code

Expand|Select|Wrap|Line Numbers
  1.     oExcel.Visible = False : oExcel.DisplayAlerts = False 
  2.  
  3.     'Start a new workbook 
  4.     oBooks = oExcel.Workbooks 
  5.  
  6.  
  7. 'Load template with chart -> this line is where the process takes time
  8.     oBooks.Open(Server.MapPath(Request.ApplicationPath) & "\MyTemplate.xls")
  9.  
  10.  
  11.      oBook = oBooks.Item(1) 
  12.     oSheets = oBook.Worksheets 
  13.     oSheet = CType(oSheets.Item(1), Excel.Worksheet) 
  14.     oSheet.Name = "First Sheet" 
  15.     oCells = oSheet.Cells 
  16.  
  17.  
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
Aug 28 '07 #1
1 2557
oBooks.Open("path of your file")
This will help ?

hi everyone!

here's my code

Expand|Select|Wrap|Line Numbers
  1.     oExcel.Visible = False : oExcel.DisplayAlerts = False 
  2.  
  3.     'Start a new workbook 
  4.     oBooks = oExcel.Workbooks 
  5.  
  6.  
  7. 'Load template with chart -> this line is where the process takes time
  8.     oBooks.Open(Server.MapPath(Request.ApplicationPath) & "\MyTemplate.xls")
  9.  
  10.  
  11.      oBook = oBooks.Item(1) 
  12.     oSheets = oBook.Worksheets 
  13.     oSheet = CType(oSheets.Item(1), Excel.Worksheet) 
  14.     oSheet.Name = "First Sheet" 
  15.     oCells = oSheet.Cells 
  16.  
  17.  
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
Aug 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ST | last post by:
Hi, I'm having problems opening up excel thru my code. It will write and saveas an excel file, but the application won't open on the user's computer, excel seems to be hidden, because it shows up...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
4
by: Vishal | last post by:
Hello, I have a dataset with some content. I can convert this dataset in a csv format which is then stored in a stringwriter. Now I want this be open via excel, so I set the contenttype...
2
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this,...
1
by: mohanprasadgutta | last post by:
Hi, I need help to open a password protected excel file in perl using Win32:OLE. when I tried to open file in normal way at the time of program execution it is prompting me to enter password. I am...
7
by: MIkeC | last post by:
I am trying to open a specific Excel speadsheet so that I can load to a table. I am using VB6 in Citrix. The code works OK when run locally but simply closes down the application without a...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
1
navanova
by: navanova | last post by:
Greetings, I have a problem of opening ms word and excel files on my computer. The files are there for a long time. I use to open and modify them. Suddenly, when i try to open the word files, a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.