Left(App.Path, 1)是用来返回路径中第一个字母,即盘符 如:C,D,E chdrive则是改变当前盘
sCurDrv =Left$(CurDir$, 1) '试着改变驱动器 ChDrive sDrive '根据是否有错误发生判断驱动器是否可用 If Err.Number = 0Then '没有发生错误-该驱动器可用 IsAvailableDrive = True Else '有错误发生-该驱动器不可用 IsAvailableDrive = False End If...
This example changes the default drive to A. Sub Button_Click Dim newdrive as String newdrive = "A" If Left(CurDir,2) <> newdrive then ChDrive newdrive End IfEnd SubSee AlsoChDir StatementCurDir FunctionDir FunctionMkDir StatementRmDir StatementSiebel VB Language Reference ...
Example This example changes the default drive to A. Sub Button_Click Dim newdrive as String newdrive = "A" If Left(CurDir,2) <> newdrive then ChDrive newdrive End If End Sub Related Topics ChDir Statement CurDir Function Dir Function ...
This example changes the default drive to A. Sub Button_Click Dim newdrive as String newdrive = "A" If Left(CurDir,2) <> newdrive then ChDrive newdrive End IfEnd SubSee AlsoChDir StatementCurDir FunctionDir FunctionMkDir StatementRmDir StatementSiebel VB Language Reference ...