VB – Scripting Host

Question:
What am I missing? I can’t compile this:

Private Sub Form_Load()Dim WshNetworkSet WshNetwork = Wscript.CreateObject("Wscript.Network")' Local name mapped to remote share  WshNetwork.MapNetworkDrive "Z:", "\NTc$"end sub

Answer:
Just leave off the Wscript of the CreateObject method as shown below. Thanks to Phil Weber.

Private Sub Command1_Click()   Dim WshNetwork      Set WshNetwork = CreateObject("Wscript.Network")      WshNetwork.MapNetworkdrive "X:", "\PDCNewe$"   End Sub
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: