Plz check these code writen in visual basic.but in line 12 give me error.error is :-
RunTime Error '9' : Subscropt Out of Range
plz give me anyone reply soon it is very urgent for me.
1. Private Declare Function ShellExecute Lib "shell32.dll" _
2. Alias "ShellExecuteA" (ByVal Hwnd As Long, _
3. ByVal lpOperation As String, ByVal lpFile As String, _
4. ByVal lpParameters As String, _
5. ByVal lpDirectory As String, _
6. ByVal nShowCmd As Long) As Long
7. Public Function OpenLocation(ByVal WhichFilePath As String, Optional sParams As String = "", Optional sStartIn As String = vbNullString, Optional lngOpenMode As Long = 1) As Long
8. OpenLocation = ShellExecute(0, "Open", WhichFilePath, sParams, sStartIn, lngOpenMode)
9. End Function
10. Private Sub cmd_bal_Click()
11. Dim x1 As String
12. xl = (Excel.Application.Workbooks("d:\s\Book4.xls").Ran ge("I5").Value)
13. xl.ActiveSheet.Range("I5").Value
14. Text1.Text = x1
15. xl.Close True, "d:\s\Book4.xls"
16. End Sub