DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Posts
    1

    VB to excel export

    hi all

    I have a vb program. i need to export the data from vb to excel. can u help me with the code.

    how to create a excel file. save the excel file and write data into it.

    the data written into the excel file exceeds 65000 rows. how can i handle that.

  2. #2
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    You can use 'output' to save data to a file as .CSV

    also, you'd have to use more than one file to get over the 65000 problem.

  3. #3
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    so...
    Code:
    open filename.csv for output as #1
    
    print #1, data (data being the variable)
    If the file doesn't exist, it SHOULD create it.

  4. #4
    Join Date
    Dec 2003
    Posts
    2,750
    See the following article:

    INFO: Methods for Transferring Data to Excel from Visual Basic

    Keep in mind that transferring this much data using automation (cell by cell) can be extremely slow. Copying it from a Recordset (CopyFromRecordset) or directly from another data source using SQL is much more efficient.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

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