Results 1 to 5 of 5

Thread: plz help me to sort it out

  1. #1

    Thread Starter
    Banned
    Join Date
    Aug 2016
    Location
    https://t.me/pump_upp
    Posts
    30

    plz help me to sort it out

    hello all.

    Im getting hdd serial with

    Set d = Fso.GetDrive(Fso.GetDriveName(Fso.GetAbsolutePathName("E:\")))

    however, if there is no E:\ drive on client system, then it gives runtime error 68/71 disk not ready/device unavailable.

    instead of this error, I want to show frm_info if E:\ is not available.

    how can i do it.

    Thanks in advance

  2. #2

    Thread Starter
    Banned
    Join Date
    Aug 2016
    Location
    https://t.me/pump_upp
    Posts
    30

    Re: plz help me to sort it out

    Admin i posted this thread in code bank by mistake....kindly move it to vbforums. Thanks.

  3. #3
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: plz help me to sort it out

    Use OnError to catch the error and show the form instead?

  4. #4

    Thread Starter
    Banned
    Join Date
    Aug 2016
    Location
    https://t.me/pump_upp
    Posts
    30

    Re: plz help me to sort it out

    i already used OnError goto handler ....handler : frm_error.show, but this also show the main form along-with error form, however, does not show any hdd serial on main form,

  5. #5
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: plz help me to sort it out

    Well, it wouldn't show any hdd serial on the main form if you had an error trying to get the hdd serial because their wasn't an E: drive.
    And I thought you said
    instead of this error, I want to show frm_info if E:\ is not available.
    so why would you be doing "frm_error.show" instead of doing "frm_info.show if E:\ is not available"?

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
      Dim fso As New filesystemObject
      Dim d
    
      On Error GoTo skipit  'don't show the error dialog, inform the user E isn't available
      Set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName("E:\")))
    
    Exit Sub
    skipit:
      Debug.Print "E: not available"
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width