Answer Posted / sugnaya
place two textbox and commandbuttons in design window
and copy this code in code window
-----------------------
Dim xl As New Excel.Application
Dim xlsheet As Excel.Worksheet
Dim xlwbook As New Excel.Workbook
Private Sub Command1_Click()
Text1.Text = xlsheet.Cells(2, 1)
Text2.Text = xlsheet.Cells(2, 2)
End Sub
Private Sub Command2_Click()
xlsheet.Cells(21, 1) = Text1.Text
xlsheet.Cells(21, 2) = Text2.Text
xlwbook.Save
End Sub
Private Sub Form_Load()
Set xlwbook = xl.Workbooks.Open("C:\Documents and
Settings\bct20vb\My Documents\sa.xls")
Set xlsheet = xlwbook.Sheets.Item(1)
End Sub
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
How would you create Visual basic Document file?
Data Control missing from toolbox when I use VB under NT3.5. Why?
Explain about ADO control?
What is rdo in vb?
What is the need of tabindex property is label control.
Maximum Control Names length?
To validate a range of values for a property whenever the property values changes,which type of property procedure you use?
What is DBSqlPassThrough?
Difference between ActiveX Control and Standard Control.
Can you tell me the properties of the controls?
How would you attach pictures in column headers of List View Control?
What is data control in vb?
Difference between DDE and OLE.
What is snapshot in vb?
Which type of object requires this object?