DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    293

    using VB6 to work with Excel

    I am useing a VB6 program to open and read an Excel workbook, to do this I have selected the Reference "Microsoft Excel 11.0 Object Library" under my project references, and in my code I have the following line:
    Set appEx = CreateObject("Excel.Application")
    Which I belive creates the excel object. However when I try and run this I get an error of: "Compile error: Variable not defined" for the appEx =

    I do not have appEx defined but then in my other programs I don't seem to have it defined either and things work ok in them. What am I missing here? what do I need other then the Excel Reference object library?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Do you have Option Explicit at the top of your code? If so, you must declare each variable before you use it.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Nov 2004
    Posts
    293
    Very good,
    I now have appEx definded as an object and all works great.

    thanks I really leaned something from this. In the past I was just "using stuff" that worked

Similar Threads

  1. VB6 with Excel
    By AM003295 in forum VB Classic
    Replies: 12
    Last Post: 10-27-2011, 12:29 PM
  2. export jpg file to excel with vb6
    By toomutch in forum VB Classic
    Replies: 5
    Last Post: 02-06-2009, 06:42 AM
  3. SPLIT doesn't work with comma delimiter in VB6
    By Lennie in forum VB Classic
    Replies: 4
    Last Post: 04-25-2008, 05:39 PM
  4. Reading Excel CSV with VB6
    By Don in forum VB Classic
    Replies: 4
    Last Post: 12-18-2007, 09:21 AM
  5. problem in opening XML with EXCEL via VB6
    By eranfox in forum VB Classic
    Replies: 5
    Last Post: 08-09-2007, 07:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links