|
-
January 4th, 2000, 03:39 PM
#1
why does this not work for me?
i want to access excel from a form in vb for which i declared
Public anyvariable As Excel.Application
this does not seem to work.
what can i do to access excel data from a vb form. help please.
-
January 4th, 2000, 03:46 PM
#2
Re: why does this not work for me?
Have you remembered to set a reference to the 'Microsoft Excel x Object Library' ?
I'm using Excel 2000 and this code works :
Dim o as Excel.Application
'
set o = new Excel.Application
MsgBox o.OperatingSystem
'
You can test this without having to set a reference :
Dim o2 as Object
'
set o2 = CreateObject("Excel.Application")
MsgBox o2.OperatingSystem
'
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
January 4th, 2000, 05:34 PM
#3
Re: why does this not work for me?
Don't forget to set your project to use the excel library in the references.
-
January 5th, 2000, 02:20 PM
#4
Re: why does this not work for me?
i am sorry to bother you but i seem to get this error
'
user defined type not defined
'
i dont know how to set the reference to the 'Microsoft Excel x Object Library' too
I'm using Excel 97 and vb does not seem to recognise excel at all. when i try to access
excel from visual data manager, it says that
driver is not recognised. what can possibly be wrong.
-
January 5th, 2000, 04:19 PM
#5
Re: why does this not work for me?
From VB, go to the 'Project', then choose 'References' (it may take a while) - then look for 'Microsoft Excel x Object Library' (where x is the version of Excel on your machine).
The code samples posted here should then compile. You can always try the other method I posted (ie. Dim xxx As Object) without setting any references.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
January 5th, 2000, 06:39 PM
#6
Re: why does this not work for me?
shell "c:\prorgam files\exel\the application.exe"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|