Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Write to Array from other closed Excel file

Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am experimenting
with NOT opening the Excel database file which is huge and takes 20 seconds
to open.

I need vb code that will get data from specified cells in an unopened Excel
file (database) and then write to an array (created in vb) in my current
file. I want to do this entirely in vb (I don't want to write a formula to
a range and then put in an array). Is this possible? Any examples?

Thanks, you guys are a great resource.

Dave



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Write to Array from other closed Excel file

Hi Dave,

You can use ADO to get data from a closed workbook. There are some
limitations, but it should be much faster than opening the workbook and
retrieving values. Once you have the recordset open, you can use the
GetRows method of the RecordSet object to put the values into a
2-dimensional array.

http://www.erlandsendata.no/english/...mportwbado.php

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am
experimenting with NOT opening the Excel database file which is huge
and takes 20 seconds to open.

I need vb code that will get data from specified cells in an unopened
Excel file (database) and then write to an array (created in vb) in
my current file. I want to do this entirely in vb (I don't want to
write a formula to a range and then put in an array). Is this
possible? Any examples?

Thanks, you guys are a great resource.

Dave


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default What is ADO?

Thanks for the reply. What is ADO a program?

dave

"Jake Marx" wrote in message
...
Hi Dave,

You can use ADO to get data from a closed workbook. There are some
limitations, but it should be much faster than opening the workbook and
retrieving values. Once you have the recordset open, you can use the
GetRows method of the RecordSet object to put the values into a
2-dimensional array.

http://www.erlandsendata.no/english/...mportwbado.php

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am
experimenting with NOT opening the Excel database file which is huge
and takes 20 seconds to open.

I need vb code that will get data from specified cells in an unopened
Excel file (database) and then write to an array (created in vb) in
my current file. I want to do this entirely in vb (I don't want to
write a formula to a range and then put in an array). Is this
possible? Any examples?

Thanks, you guys are a great resource.

Dave




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default What is ADO?

Hi Dave,

ADO (ActiveX Data Objects) is a data access library that allows you to
retrieve/update data from external sources (text files, Excel files, SQL
Server, Access, etc) without opening the host application. You basically
set up an ADO Connection, retrieve the data using a Command or Recordset
object, and the data set is stored in a Recordset object, which is basically
a collection of rows and fields (columns) that you can step through. The
Recordset object has a method named "GetRows" which will allow you to dump
the contents of the Recordset into an array.

To use this library from within Excel, you must set a reference to it (Tools
| References, Microsoft ActiveX Data Objects x.x Library).

Here's more info:

http://msdn.microsoft.com/library/de...startpage1.asp

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Thanks for the reply. What is ADO a program?

dave

"Jake Marx" wrote in message
...
Hi Dave,

You can use ADO to get data from a closed workbook. There are some
limitations, but it should be much faster than opening the workbook
and retrieving values. Once you have the recordset open, you can
use the GetRows method of the RecordSet object to put the values
into a 2-dimensional array.

http://www.erlandsendata.no/english/...mportwbado.php

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am
experimenting with NOT opening the Excel database file which is huge
and takes 20 seconds to open.

I need vb code that will get data from specified cells in an
unopened Excel file (database) and then write to an array (created
in vb) in my current file. I want to do this entirely in vb (I
don't want to write a formula to a range and then put in an array).
Is this possible? Any examples?

Thanks, you guys are a great resource.

Dave


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Thanks -It Works ! Write to Array from other closed Excel file

Thanks Jake. This has got me going in the right direction. I'm trying to
speed up a user Excel report generator that has to get data from a huge
Excel database. This way, I don't have to open the database file. This is
still slower than I'd like but I haven't tried optimizing it yet. Any ideas
to make it faster would be appreciated !!

dave


"Jake Marx" wrote in message
...
Hi Dave,

You can use ADO to get data from a closed workbook. There are some
limitations, but it should be much faster than opening the workbook and
retrieving values. Once you have the recordset open, you can use the
GetRows method of the RecordSet object to put the values into a
2-dimensional array.

http://www.erlandsendata.no/english/...mportwbado.php

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am
experimenting with NOT opening the Excel database file which is huge
and takes 20 seconds to open.

I need vb code that will get data from specified cells in an unopened
Excel file (database) and then write to an array (created in vb) in
my current file. I want to do this entirely in vb (I don't want to
write a formula to a range and then put in an array). Is this
possible? Any examples?

Thanks, you guys are a great resource.

Dave






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Thanks -It Works ! Write to Array from other closed Excel file

Hi Dave,

Great - glad to help. If you post the relevant code here, maybe someone can
help you to optimize it.

--
Regards,

Jake Marx
www.longhead.com

Dave B wrote:
Thanks Jake. This has got me going in the right direction. I'm
trying to speed up a user Excel report generator that has to get data
from a huge Excel database. This way, I don't have to open the
database file. This is still slower than I'd like but I haven't
tried optimizing it yet. Any ideas to make it faster would be
appreciated !!

dave


"Jake Marx" wrote in message
...
Hi Dave,

You can use ADO to get data from a closed workbook. There are some
limitations, but it should be much faster than opening the workbook
and retrieving values. Once you have the recordset open, you can
use the GetRows method of the RecordSet object to put the values
into a 2-dimensional array.

http://www.erlandsendata.no/english/...mportwbado.php

--
Regards,

Jake Marx
www.longhead.com


Dave B wrote:
Hello,

Excel 2000

In an effort to speed up a report generating Excel file, I am
experimenting with NOT opening the Excel database file which is huge
and takes 20 seconds to open.

I need vb code that will get data from specified cells in an
unopened Excel file (database) and then write to an array (created
in vb) in my current file. I want to do this entirely in vb (I
don't want to write a formula to a range and then put in an array).
Is this possible? Any examples?

Thanks, you guys are a great resource.

Dave


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I closed an excel file without saving the changes. Can I retrieve cliffordof fremontca Excel Discussion (Misc queries) 1 April 9th 10 12:16 AM
I closed an excel file without saving, is there a way to recover? Nick C Excel Discussion (Misc queries) 1 October 11th 06 06:41 PM
How to recover excel file that was closed without saving? JKhatavkar Excel Discussion (Misc queries) 2 October 4th 05 10:42 PM
How can I add values to a closed excel file? Ali Excel Worksheet Functions 8 June 11th 05 01:13 AM
Excel is not asking to save a changed file when the file is closed Ron Excel Discussion (Misc queries) 2 March 14th 05 01:05 AM


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"