plzz remove error

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

    #1

    plzz remove error

    Plz check error in line no. 13.here give me error that
    Error :- Run Time Error : '424'
    Object required
    plz check it these code wriiten in visual basic6.0
    plz anyone help 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


    11. Private Sub cmd_bal_Click()
    12. Dim A1C1Val As String
    13. A1C1Val = CStr(Applicatio n.Sheets("d:\s\ Book2.xls").Ran ge("I6").Value )
    14. Text1.Text = A1C1Val
    15. End Sub
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by sid1761983
    Plz check error in line no. 13.here give me error that
    Error :- Run Time Error : '424'
    Object required
    ...
    12. Dim A1C1Val As String
    13. A1C1Val = CStr(Applicatio n.Sheets("d:\s\ Book2.xls").Ran ge("I6").Value )
    14. Text1.Text = A1C1Val
    The Sheets collection returns all of the worksheets in a specified workbook. I'm almost certain you need to open the workbook first (that would be "d:\s\Book2.xls "). Then you would use the Sheets collection to access, for example, "Sheet1".

    Comment

    Working...