BrianTheLibrarian Posted September 5, 2016 Share Posted September 5, 2016 Hello I am trying to use FileMove to rename 1500 or so svg files I have. Here is the code I have put together. $len = UBound($name) $x = 0 _ArrayDisplay ($name) while $x < $len FileMove($Directory & "\" & $name[$x][0]&".svg", $Directory & "\" & $name[$x][1]&".svg" ) $x = $x+1 wend When I run it I get the error: "Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded." Thanks for any suggestions. Brian Link to comment Share on other sites More sharing options...
AutoBert Posted September 5, 2016 Share Posted September 5, 2016 Use: $len = UBound($name)-1 ;Array is 0 based so 50 elements are element 0 to 49 but you try 0 to 50 $x = 0 _ArrayDisplay ($name) while $x < $len FileMove($Directory & "\" & $name[$x][0]&".svg", $Directory & "\" & $name[$x][1]&".svg" ) $x = $x+1 wend BrianTheLibrarian 1 Link to comment Share on other sites More sharing options...
BrianTheLibrarian Posted September 8, 2016 Author Share Posted September 8, 2016 Thank you AutoBert that solved it for me! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now