DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the VBS MoveFolder methode in DIAdem without any error message?

Hi,

 

I want to move folders with the VBS MoveFolder methode, but in DIAdem I run in problems. When I use the following comman

   

fso.MoveFolder(project_folder & test_folder, project_folder & test_folder & "\" & test_ & " " & test_count)

 

I get error message

 

"During call a sub routine no parentheses are allowed!"

 

When I remove the brackets and use

   

fso.MoveFolder project_folder & test_folder, project_folder & test_folder & "\" & test_ & " " & test_count

 

I get the error message

 

"Invalid sub routine call."

 

How I have to use the command right?

 

(the text of error messages is free translated from German Version of DIAdem 11.0! Take only the sense, not the exact wording!)

 

Thanks for help.

 

Regards

 

Sven

 

 

 

 

0 Kudos
Message 1 of 3
(3,828 Views)

Hello Sven!

 

Just add a 'Call' at the beginning of your first line will solve the syntatic error. I recommend always to use 'Call' and parenthesis.

 

But there is a fundamental problem in your code: MoveFolder moves a folder from a source to a new destination and the old source folder will be deleted. You try to move a folder to a location below the same folder. If the MoveFolder wouldn't recognize these situtation and throws an error all of your data would be deleted!

 

Just print out your paths in a Messagebox to clearify the situation.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 3
(3,826 Views)

Thanks for the hint with the Call, I'll try it tomorrow morning cause I've already closed my DIAdem for today 🙂

Yes, I know about this problem with deleting the source folder. I've solved that by first creating a new Folder, then move the origin source folder into it and after that rename the folder. That works fine, even if its not the smartes way 🙂

 

Thanks

 

Sven

0 Kudos
Message 3 of 3
(3,824 Views)