D
daniel chen
Hi, Dave
I couldn't find any difference with either X: or x: in any combination
within any test macro I have below.
The resultant NUL/nul depends on the last statement used -- TestStr =
Dir("X:\NUL") / TestStr = Dir("X:\nul") respectively.
The drawback is they cannot be used in a unified way -- not even with
<Application.Run "********">.
It toggled on and off. Any comment will be appreciated.
(My target cell : C:\R_D\[ABC.xls]sheet1!A1 with phrase "Virtual Drive
Assignment Test" )
Sub auto_open()
Dim TestStr As String
TestStr = ""
On Error Resume Next
TestStr = Dir("X:\NUL")
On Error GoTo 0
If TestStr = "" Then
Shell Environ("comspec") & " /c subst x: " _
& Chr(34) & "C:\R_D" & Chr(34), vbHide
End If
Cells(2, 1) = TestStr
End Sub
Sub auto_close()
On Error Resume Next
TestStr = Dir("x:\nul")
On Error GoTo 0
If TestStr = "nul" Then
Shell Environ("comspec") & " /c subst X: /d "
End If
' Note: It became unpredictable when I added the following statements.
' If TestStr = "" Then
' Shell Environ("comspec") & " /c subst X: /d "
' End If
End Sub
Sub TroubleShoot()
TestStr = Dir("X:\nul")
Cells(2, 1) = TestStr
' Cells(2, 1) = Dir("X:\nul")
End Sub
Sub DevTest()
Cells(3, 1) = ""
Application.Run "auto_open"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Range("A1").Select
ActiveCell.FormulaR1C1 = "='X:\[ABC.xls]Sheet1'!R1C1"
Application.Run "auto_close"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Cells(3, 1) = "Thru"
End Sub
I couldn't find any difference with either X: or x: in any combination
within any test macro I have below.
The resultant NUL/nul depends on the last statement used -- TestStr =
Dir("X:\NUL") / TestStr = Dir("X:\nul") respectively.
The drawback is they cannot be used in a unified way -- not even with
<Application.Run "********">.
It toggled on and off. Any comment will be appreciated.
(My target cell : C:\R_D\[ABC.xls]sheet1!A1 with phrase "Virtual Drive
Assignment Test" )
Sub auto_open()
Dim TestStr As String
TestStr = ""
On Error Resume Next
TestStr = Dir("X:\NUL")
On Error GoTo 0
If TestStr = "" Then
Shell Environ("comspec") & " /c subst x: " _
& Chr(34) & "C:\R_D" & Chr(34), vbHide
End If
Cells(2, 1) = TestStr
End Sub
Sub auto_close()
On Error Resume Next
TestStr = Dir("x:\nul")
On Error GoTo 0
If TestStr = "nul" Then
Shell Environ("comspec") & " /c subst X: /d "
End If
' Note: It became unpredictable when I added the following statements.
' If TestStr = "" Then
' Shell Environ("comspec") & " /c subst X: /d "
' End If
End Sub
Sub TroubleShoot()
TestStr = Dir("X:\nul")
Cells(2, 1) = TestStr
' Cells(2, 1) = Dir("X:\nul")
End Sub
Sub DevTest()
Cells(3, 1) = ""
Application.Run "auto_open"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Range("A1").Select
ActiveCell.FormulaR1C1 = "='X:\[ABC.xls]Sheet1'!R1C1"
Application.Run "auto_close"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Cells(3, 1) = "Thru"
End Sub