see it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sid1761983
    New Member
    • Feb 2007
    • 13

    #1

    see it

    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.dl l" _
    2. Alias "ShellExecu teA" (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(By Val 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.Applicat ion.Workbooks(" d:\s\Book4.xls" ).Range("I5").V alue)
    13. xl.ActiveSheet. Range("I5").Val ue
    14. Text1.Text = x1
    15. xl.Close True, "d:\s\Book4.xls "
    16. End Sub
Working...