ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get data using VB? (https://www.excelbanter.com/excel-programming/275462-how-get-data-using-vbulletin.html)

Eric[_12_]

How to get data using VB?
 
- not sure if this belongs here or some VB group, but I'll try here -

I am a bit of an expert at programming, but a beginner at VB. I have VB6.0
and I cannot seem to figure out just how to get information from Excel. I
just want to write a simple program that can read Excel documents and write
them out as text files. We already have a program that reads text files and
writes them out as Excel documents, but I can't figure out if there's a
simple way to reverse it, or if the reverse process uses entirely different
commands. I looked through the VB database on msdn.microsoft.com but I
can't make sense of it.
Can anyone tell me where to start, or point me to a sample code program that
does this?



Tom Ogilvy

How to get data using VB?
 
If your data is set up like a database on one sheet, then perhaps:

http://www.erlandsendata.no/english/vba/adodao/

http://support.microsoft.com/?kbid=257819
HOWTO: Use ADO with Excel Data from Visual Basic or VBA


http://support.microsoft.com/?kbid=278973
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in Excel
Workbooks

Otherwise, you would need to use OLE Automation to open Excel as an
application, then manipulate the excel object model to do what you describe.
(which is an option even if your data is set up like a database on one
sheet).

Microsoft Office 97 Automation Help File Available (Q167223)
http://support.microsoft.com/default...b;EN-US;167223

Microsoft Office 2000 Automation Help File Available (Q260410)
http://support.microsoft.com/default...b;EN-US;260410

Microsoft Office XP Automation Help File Available (Q302460)
http://support.microsoft.com/default...b;EN-US;302460

http://msdn.microsoft.com/library/en...ortal_7l45.asp
Automation Programmer's Reference


http://support.microsoft.com/default...b;EN-US;253235
FILE: OFFAUTMN.EXE Discusses Office 97 and 2000 Automation and Provides
Sample Code

--
Regards,
Tom Ogilvy


"Eric" wrote in message
...
- not sure if this belongs here or some VB group, but I'll try here -

I am a bit of an expert at programming, but a beginner at VB. I have

VB6.0
and I cannot seem to figure out just how to get information from Excel. I
just want to write a simple program that can read Excel documents and

write
them out as text files. We already have a program that reads text files

and
writes them out as Excel documents, but I can't figure out if there's a
simple way to reverse it, or if the reverse process uses entirely

different
commands. I looked through the VB database on msdn.microsoft.com but I
can't make sense of it.
Can anyone tell me where to start, or point me to a sample code program

that
does this?





Eric[_12_]

How to get data using VB?
 
That seems to have worked just fine The application is reading in my Excel
document and writing it to the screen. Now I just need to figure out the
syntax to write the information to a text file.

"Tom Ogilvy" wrote in message
...
If your data is set up like a database on one sheet, then perhaps:

....
http://support.microsoft.com/?kbid=278973
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in

Excel
Workbooks

....
--
Regards,
Tom Ogilvy




Eric[_12_]

How to get data using VB?
 
That will work. Thanks!

"Tom Ogilvy" wrote in message
...
http://support.microsoft.com/support...eio/fileio.asp
File Access with Visual Basic® for Applications

--
Regards,
Tom Ogilvy

"Eric" wrote in message
...
That seems to have worked just fine The application is reading in my

Excel
document and writing it to the screen. Now I just need to figure out

the
syntax to write the information to a text file.





All times are GMT +1. The time now is 04:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com