close

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;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()