Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
About import / view of a excel file through VB..
Message
 
To
06/09/2000 02:09:38
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00412346
Message ID:
00412885
Views:
23
>Thx for your reply.
>
>But as you know the default setting of a new excel file will hv 3 sheet inside it. So , is that i need to clarify which sheet i need to open for compare. Also, what is the syntax that retrieve the field context?! (say, row / col. )

You can use the Worksheets object like this:
Private Sub Command1_Click()
Dim XL As Excel.Application

    'Open Excel
    Set XL = New Excel.Application
    XL.Visible = True
    
    'Create a new workbook
    XL.Workbooks.Add
    
    'Put data on the second sheet
    XL.Worksheets("Sheet1").Range("A1").Value = "Hello 1"
    XL.Worksheets("Sheet2").Range("B2").Value = "Hello 2"
    XL.Worksheets("Sheet3").Range("C3").Value = "Hello 3"
    
    'Get data from worksheets
    MsgBox XL.Worksheets("Sheet1").Range("A1").Value

    XL.Quit
    Set XL = Nothing
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform