Dear experts:
I want to get the amount of free disk space on a drive or network
mapped drive, and store it in a cell. ¿How can you do that?
Thank you very much,
Mr.Clinker
Uruguay--
mrclinker
------------------------------------------------------------------------
mrclinker's Profile: www.excelforum.com/member.php...oamp;userid=33907
View this thread: www.excelforum.com/showthread...hreadid=541510Function GetDriveSpace(DriveLetter As String)
Dim oFSO As Object, oDrive As Object
If Right(DriveLetter, 1) lt;gt; quot;:quot; Then DriveLetter = DriveLetter amp; quot;:quot;
Set oFSO = CreateObject(quot;Scripting.FileSystemobjectquot;)
Set oDrive = oFSO.getDrive(DriveLetter)
GetDriveSpace = oDrive.freespace
Set oDrive = Nothing
Set oFSO = Nothing
End Function--
HTH
Bob Phillips
(remove xxx from email address if mailing direct)
quot;mrclinkerquot; gt; wrote
in message ...
gt;
gt; Dear experts:
gt;
gt; I want to get the amount of free disk space on a drive or network
gt; mapped drive, and store it in a cell. ¿How can you do that?
gt;
gt; Thank you very much,
gt;
gt; Mr.Clinker
gt; Uruguay
gt;
gt;
gt; --
gt; mrclinker
gt; ------------------------------------------------------------------------
gt; mrclinker's Profile:
www.excelforum.com/member.php...oamp;userid=33907
gt; View this thread: www.excelforum.com/showthread...hreadid=541510
gt;
In VBE: Toolsgt;References tick Microsoft Scripting Runtime
Function FreeSpace(sDriveName As String)
Static oFSO As FileSystemObject
If oFSO Is Nothing Then Set oFSO = New FileSystemObject
FreeSpace = oFSO.GetDrive(sDriveName).FreeSpace
End Function
HTH
--
AP
quot;mrclinkerquot; gt; a écrit
dans le message de news:
...
gt;
gt; Dear experts:
gt;
gt; I want to get the amount of free disk space on a drive or network
gt; mapped drive, and store it in a cell. ¿How can you do that?
gt;
gt; Thank you very much,
gt;
gt; Mr.Clinker
gt; Uruguay
gt;
gt;
gt; --
gt; mrclinker
gt; ------------------------------------------------------------------------
gt; mrclinker's Profile:
gt; www.excelforum.com/member.php...oamp;userid=33907
gt; View this thread: www.excelforum.com/showthread...hreadid=541510
gt;
- Jul 20 Thu 2006 20:08
Getting Amount Free Disk Space On A Drive
close
全站熱搜
留言列表
發表留言