Debugging help needed: Run-time error '70': Permission Denied

Can someone help me debug the attached.  What I have for Command4_Click() works perfectly.  I have just copied this and changed the import specification and table name for Command12_Click().  When I run Command12_Click(), I receive Run-time error '70': Permission Denied
Who is Participating?
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
When in Debug mode, after it generates the error and the yellow bar is over the File Copy line, mouse over strInputFileName and strFileTemp and make sure they are correctly formatted paths and file names.

If mousing over doesn't work, the go into your Immediate Windows (Ctrl-G), type ?strInputFileName {return} and ?strFileTemp  {return} to view what is in these variables.
kgittingerAuthor Commented:
Thank you very much
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim

btw I HIGHLY recommend you do this:
(1)  In any code window go to Tools:References
(2)  Set a reference to 'Microsoft Scripting Runtime', a.k.a. File System Object
(3)  In whatever free time you have play with the .FileExists and .FolderExists methods, as these will enable you to screen what the users enter for files, to make sure they are legit.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.