Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Oct 2002
    Blue Mountains, New South Wales, Australia
    Thanked 0 Times in 0 Posts

    Finding available space on a Novell drive (VBA - Word 97 SR2)

    <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18> I use macros to store info in the system registry used by a range of word template. I want to back these up in an INI file on a Novell network drive. However, sometimes, there is insufficient space on the Netware drive.

    Can anyone help with how to determine in VBA how much space is available on the Netware drive???

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Dublin, Ireland, Republic of
    Thanked 0 Times in 0 Posts

    Re: Finding available space on a Novell drive (VBA - Word 97 SR2)

    The following function will return the free space in bytes on for a given drive :

    Function FreeSpace(strDrive As String) As Double
    Dim fso, dr
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set dr = fso.GetDrive(fso.GetDriveName(strDrive))
    FreeSpace = dr.FreeSpace
    End Function

    The function could be set to return a Long, but if the free space exceeds approx 2 gigabytes, an error would result. You could convert to kilobytes by using

    FreeSpace = dr.FreeSpace / 1024

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts