Hallo friends,
This is Kiran I have been trying to open an excel file and search in it for a specific number and select that cell from access.
Previously I got a problem that it is always opening a new copy of the file but I have solved this problem by using GetObject( ) function which is opening every time only the same file but if I open a file with this function.
The selection of a cell is working If there is only this file is opened , if another Excel file is also opened then the line which has selecting a cell in the excel file is giving an error.
But our users will definitely open other excel files when they are working with my project so I must find a way which can work even other excel files are opened.
As I spent so many days on this, now am in a peek stage please help me. Any help will be great for me.

Here is my code.

Set myXl = GetObject("C:\Dokumente und Einstellungen\Kiran Karnati\Desktop\EXCEL\Book2.XLS")

XlBookCnt = myXl.Parent.Windows.Count

If XlBookCnt > 1 Then
For i = 1 To XlBookCnt
If myXl.Parent.Workbooks(i).FullName = "C:\Dokumente und Einstellungen\Kiran Karnati\Desktop\EXCEL\Book2.XLS" Then
myXl.Application.Visible = True
myXl.Parent.Windows(i).Visible = True
Label48.Caption = myXl.Worksheets("Sheet1").Cells(1, 2).Value
myXl.Worksheets("Sheet1").Cells(1, 10).Select
End If
Next i

myXl.Application.Visible = True
myXl.Parent.Windows(1).Visible = True
Label48.Caption = myXl.Worksheets("Sheet1").Cells(1, 2).Value  this line is has error
myXl.Worksheets("Sheet1").Cells(1, 10).Select
End If