Get data from an array created in Excel 
Author Message
 Get data from an array created in Excel

In Excel I created code to import an ascii file,
manipulate the data, and store it in a public array when
the spreadsheet is opened.  In Access there is a button
that opens this spreadsheet.  After the spreadsheet runs,
I want to be able to access the data created in the
array.  How do I do this?  Also, what library references
are needed?  Any help would be greatly appreciated.


Sun, 28 Dec 2003 23:37:20 GMT  
 Get data from an array created in Excel

Quote:
>-----Original Message-----
>In Excel I created code to import an ascii file,
>manipulate the data, and store it in a public array when
>the spreadsheet is opened.  In Access there is a button
>that opens this spreadsheet.  After the spreadsheet runs,
>I want to be able to access the data created in the
>array.  How do I do this?  Also, what library references
>are needed?  Any help would be greatly appreciated.

The attachment didn't go through, so here's the code I'm
currently using:

In VBAProject(Profile.xls) under Modules, in Module1 under
declarations I have

Public Depth_Percent(2,500000) As Double
Public API_Date(2,500000) As String
Public X As Double

These are the three variables I would like to use in
Access that are created in Excel.  The procedure in
Module1 creates the arrays.

Under ThisWorkbook I Call the procedure in Module1 to run
when the workbook is open.

In Access, I have a Module in the Module group called
GetProfileData.  Here is what is under that:

Option Compare Database
Option Explicit

Public Sub Import_ProfileData()

Dim I As Double
Dim db As Database
Dim rst As Recordset

Set db = CurrentDb
Set rst = db.OpenRecordset("ProfileData")

For I = 1 To X
    rst.AddNew
    rst![API NUMBER] = API_Date(1, X)
    rst![Depth] = Depth_Percent(1, X)
    rst![DATE] = API_Date(2, X)
    rst![PERCENT] = Depth_Percent(2, X)
    rst.UPDATE
Next I

End Sub



Mon, 29 Dec 2003 00:29:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting data values to CR from variable arrays and stand alone variables in VB

2. Declaring an array of pointers in Visual Basic (and putting and getting data from it)

3. Declaring an array of pointers in Visual Basic (and putting and getting data from it)

4. Getting data from security-enabled Access 2 to Excel 7 using DAO

5. Getting Tab separated data from Word to Access, Excel or simply process it from VB

6. Getting real-time data from Excel

7. getting Excel data into body

8. Getting data of an Outlook/Exchange folder to Excel

9. Need help getting data from an excel file

10. help needed getting Excel data into TSV Actual Work

11. Getting Tab separated data from Word to Access, Excel or process it from VB

12. Getting Cell data from excel into a variable

 

 
Powered by phpBB® Forum Software