VB Script in Excel....Please Help...Dead Easy if You've done it before 
Author Message
 VB Script in Excel....Please Help...Dead Easy if You've done it before

I have a problem with VB code in an excel macro.
I want to read data from a spreadsheet then write the info to a database
using ODBC.

I have included the ODBC add-in to Excel; then started my module :-

    Dim wrkODBC As Workspace
    Dim PCdb As Connection

    Dim cu As Recordset
    Dim criteria As String

 ' Create ODBCDirect Workspace object and open Connection

    Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
        "admin", "", dbUseODBC)

etc.....

The Problem is .... When I try to run it, it says "Workspace" is not a
valid data type (neither is "Connection")
??????????

What am I missing ????



Sat, 04 Nov 2000 03:00:00 GMT  
 VB Script in Excel....Please Help...Dead Easy if You've done it before

You might not have the Data Access Objects reference in
your Excel environment set.

From the VBE, select < Tools | References >, then select
(check) the MS DAO 3.5 library.
Should work after that.

Cheers,
-Paul Smith

Quote:

>I have a problem with VB code in an excel macro.
>I want to read data from a spreadsheet then write the info to a database
>using ODBC.

>I have included the ODBC add-in to Excel; then started my module :-

>    Dim wrkODBC As Workspace
>    Dim PCdb As Connection

>    Dim cu As Recordset
>    Dim criteria As String

> ' Create ODBCDirect Workspace object and open Connection

>    Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
>        "admin", "", dbUseODBC)

>etc.....

>The Problem is .... When I try to run it, it says "Workspace" is not a
>valid data type (neither is "Connection")
>??????????

>What am I missing ????



Sun, 05 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Now I've really done it!!

2. Craziest thing you've done with VBA?

3. if you've done six impossible things before breakfast

4. Please help i've tried everything else - vb3.0

5. I've heard of this being done in VC++

6. Please assist a VB newbie with an easy Excel question

7. Please help me it's about VB and excel

8. please help easy question can't find out how to get it

9. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

10. Please tell me I've just missed something

11. I've programmed a game that don't work Help

12. Can I bring in stuff I've done in Excel and Access into VB ?

 

 
Powered by phpBB® Forum Software