expected function or variable
VB Code:
Option Explicit
Dim FSO As New FileSystemObject
Private Sub Form_Load()
Copy = FSO.CopyFolder(App.Path + "\" + "files" + "\", "C:\files", True)
I am using the code above to copy the folder "files" from the app path to c:\, when i try to run the app a compile error occurs, a msgbox comes up saying
"compile error expected function or variable"
then .CopyFolder is highlighted.
Re: expected function or variable
You haven't declared the variable you used "Copy"?
try:
VB Code:
call FSO.CopyFolder(App.Path + "\" + "files" + "\", "C:\files", True)
Re: expected function or variable
I also get a problem like that but the phrase "FileSystemObject" cannot be recognised. What do I suppose to do ?
Re: expected function or variable
You need to set reference to "Microsoft Scripting Runtime"
Re: expected function or variable
It's fine now. Thanks for your cooperation.