Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 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 July 4th, 2007, 01:57 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default VB and Excel

Is it excel file can import to the vb file???
please help me...

 
Old July 4th, 2007, 02:07 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

ur question is not clear...wht exactly u wanna do????
if u mean tht u wanna fetch data from Excel file from V6 then, u can do it using VBA
search google for "VBA with Excel examples"



 
Old July 4th, 2007, 04:25 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

Like that thanks a lots.:D
Quote:
quote:Originally posted by ashu_from_india
 ur question is not clear...wht exactly u wanna do????
if u mean tht u wanna fetch data from Excel file from V6 then, u can do it using VBA
search google for "VBA with Excel examples"



 
Old July 9th, 2007, 02:09 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

Sorry ask again...So the VBA can't be an installer to install in the computer,right?:D
Quote:
quote:Originally posted by ivanlaw
 Like that thanks a lots.:D
Quote:
quote:Originally posted by ashu_from_india
Quote:
 ur question is not clear...wht exactly u wanna do????
if u mean tht u wanna fetch data from Excel file from V6 then, u can do it using VBA
search google for "VBA with Excel examples"



 
Old July 9th, 2007, 02:15 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

ivanlaw

Do you mean Install for 'Creating a Setup for Deployment'. If that is the case then VBA would not help you in creating Setup. You need to use VB6.0 Package and Deployment wizard for that.

On the otherhand, if you want to distribute your macros to others you can give them as part of Excel file (As Excel Addins (.xla)

Hope iy gives you better clarity

Regards
Shasur


http://www.dotnetdud.blogspot.com
 
Old July 10th, 2007, 01:17 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

That is right.But like that...Is it the Excel file can import to the VB 6.0???
Or got any method to do that???
Thanks~
Quote:
quote:Originally posted by Shasur
 ivanlaw

Do you mean Install for 'Creating a Setup for Deployment'. If that is the case then VBA would not help you in creating Setup. You need to use VB6.0 Package and Deployment wizard for that.

On the otherhand, if you want to distribute your macros to others you can give them as part of Excel file (As Excel Addins (.xla)

Hope iy gives you better clarity

Regards
Shasur


http://www.dotnetdud.blogspot.com
 
Old July 10th, 2007, 03:17 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here is the way you can access Microsoft Excel from VB6.0

1. Include the Microsoft Excel 9.0 Library in your project reference (Project menu --> References)

2. Use the following code to get the Excel Application

Dim oXlApp As Excel.Application
Dim oDataFile As Excel.Workbook

Set oXlApp = New Excel.Application
Set oDataFile = oXlApp.Workbooks.Open("c:\sample.xls")

..

you can use all the objects you use in Excel VBA in Vb6.0 now on

Cheers
Shasur



http://www.dotnetdud.blogspot.com
 
Old July 11th, 2007, 02:40 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

I put all the code you give in the form load,but still can not do it.Why?
Then another question is how did I fully utilize the OLE component???
Please teach me...:)
Thanks~:D
Quote:
quote:Originally posted by Shasur
 Here is the way you can access Microsoft Excel from VB6.0

1. Include the Microsoft Excel 9.0 Library in your project reference (Project menu --> References)

2. Use the following code to get the Excel Application

Dim oXlApp As Excel.Application
Dim oDataFile As Excel.Workbook

Set oXlApp = New Excel.Application
Set oDataFile = oXlApp.Workbooks.Open("c:\sample.xls")

..

you can use all the objects you use in Excel VBA in Vb6.0 now on

Cheers
Shasur



http://www.dotnetdud.blogspot.com
 
Old July 11th, 2007, 03:11 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi ivanlaw

Can you post the part of the code that is showing error. This should be useful in fixing the problem

Regards
Shasur

http://www.dotnetdud.blogspot.com
 
Old July 12th, 2007, 08:11 PM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

So strange.Today just try it no error,but all the thing can not display.
I can't find the Microsoft Excel 9.0 Library ,but include Microsoft Excel 11.0 Library.Is it correct or useful ???
:(
Quote:
quote:Originally posted by Shasur
 Hi ivanlaw

Can you post the part of the code that is showing error. This should be useful in fixing the problem

Regards
Shasur

http://www.dotnetdud.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel with VB arijit_bose VB How-To 2 April 21st, 2005 05:43 AM
vb to excel. sonurijs Excel VBA 1 March 14th, 2005 05:43 AM
Excel and VB Marcela Excel VBA 1 May 21st, 2004 01:29 PM
vb with excel PHANI KISHOREKOTTAPALLI Excel VBA 4 May 18th, 2004 08:03 PM





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