Random Excel VBA programming tip? of the day: If you want to - TopicsExpress



          

Random Excel VBA programming tip? of the day: If you want to automate making folders and saving files to them, use the MkDir command in your code. If you run into Errors 75 and/or 76 even though you know your filepath is correct, cast it as a string first using CStr($CORRECT_FILEPATH$) and THEN call MkDir with it. I was making folders on the desktop and there is a space in that filepath, so casting the filepath to a string ensured that the program was writing to that filepath and not ending at the space, just like in DOS you might have to wrap a filepath with spaces in quotes... LOL! I tested this by choosing a directory, in which to make directories, in C:\ so no spaces, that worked fine as expected. So I went back and selected the directory on my desktop again , without casting it as a string... And this time it worked fine. so... I have no idea why the hell it didnt work before... Ill just cast the dam thing to be safe... Such is programming
Posted on: Fri, 15 Nov 2013 17:41:02 +0000

Trending Topics



Recently Viewed Topics




© 2015