steve99 0 Newbie Poster

Hi there,

Here's the code I'm using below and yet I'm getting a "Method 'Initialize' of object 'DIDiskQuotaControl' failed" at the line "vol.Initialize ........"

Reference to Microsoft Disk Quota Type Library is set - do I have to set or initialize anything else beforehand?

Can anybody help please? Thanks!

--- Code ------------------------------------------

Dim vol
Set vol = CreateObject("Microsoft.DiskQuota.1")
vol.Initialize "C:\", True
Dim quotaUser, results
results = ""
Dim spaceUsed
For Each quotaUser In vol
spaceUsed = Round(quotaUser.QuotaUsed / (1024 * 1024), 2)
results = results & _
quotaUser.LogonName & vbTab & _
"[" & spaceUsed & "]" & _
vbCrLf
Next
MsgBox results

--- End Code --------------------------------------------------------

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.