Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MsgBox not showing
#1
Solved: 10 Years, 10 Months, 2 Weeks ago
I am trying to copy a folder using FSO in vb using below code :
Code:
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
FSO.CopyFolder "C:\Program Files\Test", "E:\Test"

If err.number <> 0 Then
    FSO.CreateFolder "E:\Test"
    FSO.CopyFolder "C:\Program Files\Test", "E:\Test"
    MsgBox "Folder Copied"
End If

With this code MsgBox doesnt show up, but the folder is copied successfully. But if I move the MsgBox statement outside the If segment, then it shows correctly.

Code:
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
FSO.CopyFolder "C:\Program Files\Test", "E:\Test"

If err.number <> 0 Then
    FSO.CreateFolder "E:\Test"
    FSO.CopyFolder "C:\Program Files\Test", "E:\Test"    
End If
MsgBox "Folder Copied"

Someone please explain this behavior.
Reply


Messages In This Thread
MsgBox not showing - by arescool - 06-12-2013, 01:22 PM
RE: MsgBox not showing - by basanth27 - 06-12-2013, 02:08 PM
RE: MsgBox not showing - by arescool - 06-12-2013, 02:28 PM
RE: MsgBox not showing - by basanth27 - 06-12-2013, 03:19 PM
RE: MsgBox not showing - by vinod123 - 06-13-2013, 03:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Disabled Webelement is showing up as Visible =True in GUI Spy Shwethareddy 3 3,612 11-07-2012, 02:45 PM
Last Post: Ankesh
  get all text showing on web page daniel_QTP 3 13,833 09-25-2012, 12:44 PM
Last Post: jesonvan

Forum Jump:


Users browsing this thread: 1 Guest(s)