If you have a lot of file and folder operations, you might find it easier in the long run to use the File System Object, which has simplified calls for a lot of what you are doing. The link gets you to the top of a documentation "tree" for FSO.
Office VBA reference topic
learn.microsoft.com
However, there is another question. I looked at your posts but didn't see it mentioned. Are you using 32-bit or 64-bit Access? The problem you report sounds like you tried to use a 32-bit function in a 64-bit Access environment. If you search the forum for 64-bit Access, you will find lots of posts on using PtrSafe and other methods to keep everything quiet and happy.