List of properties and methods for Excel object
I am using late binding method to use Excel object in VB6. My problem is for code like
VB Code:
Set oXLBook = oXLApp.Workbooks.Add 'Add a new workbook
is easy and well known but what about other complicated codes ? for example how do I set Header and Footer and etc.
Basically I would like to know is there a way I can find out the list of properties or methods for Excel and how to use it?
Re: List of properties and methods for Excel object
Look through the Object Browser (press F2 while in the VBA IDE). Another easy trick is to use Early Binding where you set a reference to Excel in your project. Write all your code and then remove the reference. This allows you to have the intellisense during debugging, etc. Then after removing the reference you will be back to Late Binding.
Re: List of properties and methods for Excel object
One method is to record a Macro from within Excel, and view the resultant code created (Macros>Edit).
You could start a recording, and then go thru the motions of adding a Header and Footer, stop recording and view the code.
You can use that as a basis over in VB6.
Alternatly, you could look at the VBA Methods/Properties/Functions etc on the MSDN web site (start with the MSDN link in my signature and navigate your way across to VBA (Visual Basic for Applications).
Re: List of properties and methods for Excel object
Quote:
Originally Posted by Bruce Fox
One method is to record a Macro from within Excel, and view the resultant code created (Macros>Edit).
You could start a recording, and then go thru the motions of adding a Header and Footer, stop recording and view the code.
You can use that as a basis over in VB6.
Alternatly, you could look at the VBA Methods/Properties/Functions etc on the MSDN web site (start with the MSDN link in my signature and navigate your way across to VBA (Visual Basic for Applications).
it sounds very interesting unfortunately I have never done any macro and no experience using it. Is macro easy and fast to learn? I guess I'll start picking up macro if it is worthed. Thanx
Re: List of properties and methods for Excel object
Quote:
Originally Posted by RobDog888
Look through the Object Browser (press F2 while in the VBA IDE). Another easy trick is to use Early Binding where you set a reference to Excel in your project. Write all your code and then remove the reference. This allows you to have the intellisense during debugging, etc. Then after removing the reference you will be back to Late Binding.
Thanx Rob .. after few years coding in VB6 I realized now the use of F2 (object browser) :o
I guess I'd be asking too much if there's any examples on how to use those "classes" and "members" huh? :p
Re: List of properties and methods for Excel object
Re: List of properties and methods for Excel object
Quote:
Originally Posted by leinad31
After downloaded and extracted the file I get a script error whenever I try to browse the contents. Am I the only one facing that problem?
Re: List of properties and methods for Excel object
Re: List of properties and methods for Excel object
Look for vbaxl10.chm in C:\Program Files\Microsoft Office\OFFICE11\1033 (unless you installed in another location) and double click the file.