How to use "is nothing" ? (synthax)

  • Thread starter Thread starter t f
  • Start date Start date
T

t f

Hello,


Have you some code to translate this in vba ?
---------------------------------------------

if the folder "myfolder" exists then
delete this folder "myfolder" (and all items inside)
else
create this folder "myfolder" (prepare it to store items)
end if


Have you the exact synthax because it fails on my computer
with actual code ?

I have tried with the keyword "Is Nothing" but with no success.




Thank you
Tony
 
If myObject Is Nothing Then
' don't try to use any properties or methods from myObject
Else
' it's OK to use myObject properties and methods
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top