Consulting

Results 1 to 4 of 4

Thread: FSO Object used in VBA code?

  1. #1
    VBAX Newbie
    Joined
    Apr 2019
    Posts
    2
    Location

    FSO Object used in VBA code?

    Since we need to explicitly allow excel to use ms scripting runtime dll before we can use FSO, does this mean the code cannot be used by anyone else?
    thanks

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    .
    Not quite certain what your mean in your question. Let me say two things :


    Excel is not very secure. By design it is almost impossible to protect VBA code from being accessed / used by others.

    Because of the lack of security, anyone can access your code and do anything with it.


    Do these comments answer your question ?

  3. #3
    If you use late binding to the Scripting.FileSystemObject e.g.

    Dim FSO As Object
        Set FSO = CreateObject("Scripting.FileSystemObject")
    the code can be used by anyone using Excel in Windows without specifically setting a reference to it as the appropriate DLL will be almost certainly be available.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  4. #4
    VBAX Newbie
    Joined
    Apr 2019
    Posts
    2
    Location
    Thank you for your response, I was curious because it would not run (gave error) if I did not set the reference. I will try on other machines and see now.
    Regards

Posting Permissions

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