Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2005, 06:14 AM
Authorized User
 
Join Date: Sep 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default select records from excel

Hi

Im having some troubles talking to excel from my vb addin I made.
This code to send data to excel from a db works great:

Dim xlApp As Excel.Application
Dim xlWb As Workbook
Dim xlWs As Worksheet

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add
Set xlWs = xlWb.Worksheets("Sheet1")

Now im now trying to pick up the changes and send it back from the active excel workbook, I cant seem to reference the active workbook...
This is the code im using:

Dim xlApp As Excel.Application
Dim xlWb As Workbook
Dim xlWs As Worksheet

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.ActiveWorkbook
Set xlWs = xlWb.ActiveSheet

Any ideas from anyone ?

Thanks andy...
 
Old March 22nd, 2005, 06:39 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using, Microsoft Excel Driver, provided by ODBC. There you can use
normal SQL statements to get the data from the cell or range of cells.

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
how i can select this records dhua SQL Server 2000 0 February 8th, 2007 11:56 PM
Displaying Records From SELECT dropdown mgordon Classic ASP Databases 12 August 3rd, 2005 12:27 PM
select out last 10 records markhardiman SQL Language 4 September 30th, 2004 04:45 AM
Select Records from this year only morpheus Classic ASP Databases 8 September 17th, 2004 09:03 PM
Select records NOT in table davesav SQL Server ASP 2 June 10th, 2003 04:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.