Please help me to open the excel file, to read it and to list into the combo boxes... please... se the sa,ple... i`ve try it already to but i cant do it,,, i dont know how... from where to start and where to stop.. please help me!
See the sample!
Printable View
Please help me to open the excel file, to read it and to list into the combo boxes... please... se the sa,ple... i`ve try it already to but i cant do it,,, i dont know how... from where to start and where to stop.. please help me!
See the sample!
2 thing you need 2 know :
1 how to use excel in VB
2 macro recorden in excel.
The first is not difficult at all. Can be found on this forum easily, but here is a start:
First make a reference to:
Microsoft Excel 8.0 Object Liberary
then you can do this:
VB Code:
Private m_objExcel As Excel.Application Dim m_Sheets As Excel.Sheets Private Function CreateExcelObject() As Boolean On Error GoTo ErrorHndl If (TypeName(m_objExcel) <> "Application") Then Set m_objExcel = CreateObject("excel.Application") End If CreateExcelObject = True Exit Function ErrorHndl: CreateExcelObject = False End Function
Second the macro recorder, this can be used to record stuff you do, then you can see the code. If you past that code into it can run, after you called the createexcelobject.
please help me with this sample...
Here ya go! I have also included code to terminate the excel process,because many people got probs with that.
Thanks libero!
The sample is a fine begining but... i dont know how to put the sheet "Autor 2" into the combo 2... in this sample is not specified the shhet number... and the labels years... :confused:
Anyone can help me more... ?!? Please....
no one can help me to resolve this problem ?! please... who knows... please help me... :(
I will have a look at that when i return to work on Tuesday ( if you havent resolved it until then ), cause i havent installed VB on my home pc for the moment.
Thanks libero... i`ll wait your post... thanks again!
Libero are u here ?! Please...
Working on it right now..... Sorry, i was on vacation yesterday..
Here we go... You may have to clean up the code a bit, because i was in a bit of hurry. But its working on my PC now.. Good luck!!:wave:
Thanks for your help man. Thanks again! I wish i cold give u a beer!:wave:
:thumb: You can PM me the beer. Only glad to help..:wave: