Link to home
Create AccountLog in
Avatar of Elmo Erasmus
Elmo ErasmusFlag for Namibia

asked on

Create and delete folder using VBA

Hi All
I need some code that will create a folder on the C drive after i've done what i needed i need to delete the folder again. I need to do this with VBA from a button on an Access Form.
Thanks in advance
Elmo
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Elmo Erasmus

ASKER

Got the create part done. Just need to be able to delete it now.
  Dim fsys As New Scripting.FileSystemObject
      fsys.CreateFolder "C:\Myfolder"

'Do your stuff

    fsys.DeleteFolder "C:\Myfolder", True

Needs tools -> references, check MS scripting runtime
Posted too late.  LSM posted what you need.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks for all the quick responces