Folder size in Access VBA

Dear experts -
We had a routine that was working perfectly, but now it is choking on determining the size of a given folder with the 3 lines below.
I imagine it has something to do with the new server, which is running MICROSOFT WINDOWS SERVER 2012 R2 Datacenter.

It seems to be choking on the following lines:

    Set objfso = CreateObject("Scripting.FileSystemObject")
    Set objfolder = objfso.GetFolder(thisname)
    tsfoldersize = objfolder.Size

Any ideas? Alternate approaches? (We are running a report and for each directly listed, we need to show the folder size)

Thanks!
terpsichoreAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Choking as in it returns an error?  Hangs?

The only thing right off is the data type of tsfoldersize; it may not be large enough.

Jim.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
terpsichoreAuthor Commented:
This pointed me in the right direction - I changed data type and also added in some error checking in case the folder didn't exist and it is now working. thank you!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.