mallikagattala
New Member
- Joined
- Jun 26, 2008
- Messages
- 2
Sub test()
Dim appexcel As Object
Set appexcel = CreateObject("excel.application")
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Show
fname = .SelectedItems(1)
End With
appexcel.Workbooks.Open (fname)
appexcel.Visible = True
appexcel.Worksheets("Sheet1").Select
appexcel.Range("D4").Select
take = appexcel.ActiveCell 'take is having location of l
appexcel.Range(take).Select
l = appexcel.ActiveCell
If l = 22 Then
MsgBox "i am happy "
End If
End Sub
there are 2 workbooks work book1 and workbook 2 ...workbook 1 has values ....whose positions may be changing ...so the user stores their position or ranges in workbook2 (which are fixed)....like cell in work book2 has locations of various parameters in workbook1....i have to store this location(say may be PQ) and open the workbook and print range("PQ") of workbook1 i have problems in getting controls back and forth to 2 workbooks and i am using vbe of workbook1...
i am new to vb ....so please be very descriptive in answering this
thanks a lot
Dim appexcel As Object
Set appexcel = CreateObject("excel.application")
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Show
fname = .SelectedItems(1)
End With
appexcel.Workbooks.Open (fname)
appexcel.Visible = True
appexcel.Worksheets("Sheet1").Select
appexcel.Range("D4").Select
take = appexcel.ActiveCell 'take is having location of l
appexcel.Range(take).Select
l = appexcel.ActiveCell
If l = 22 Then
MsgBox "i am happy "
End If
End Sub
there are 2 workbooks work book1 and workbook 2 ...workbook 1 has values ....whose positions may be changing ...so the user stores their position or ranges in workbook2 (which are fixed)....like cell in work book2 has locations of various parameters in workbook1....i have to store this location(say may be PQ) and open the workbook and print range("PQ") of workbook1 i have problems in getting controls back and forth to 2 workbooks and i am using vbe of workbook1...
i am new to vb ....so please be very descriptive in answering this
thanks a lot