PDA

View Full Version : Runtime Error 9



shrivallabha
05-28-2010, 09:26 PM
I'll refer to the post I had posted previously, see post #4.
http://www.vbaexpress.com/forum/showthread.php?t=30915&highlight=subscript+out+of

I had gotten around the error after tweaking the code a little.

SheetName = Workbooks("MTO").Sheets(SheetNo).Name + ".DAT"

By throwing ".DAT" (File Extension) out.

Now I felt my program would do OK but I tested it on yet another machine and the same error 9 would come but the program would execute. What I found is little strange but seems to solve problem for me.

Just on a hunch since it involved file extensions. I went to
Windows Explorer >> Folder Options >> View Files >> And checked in
Hide Extensions for known file types. (See Attached Screenshot)

And the problem disappeared. I hope this might help someone so posted. Probably, we can have a section (sub-forum) as "LESSONS LEARNED", (I hope nobody minds my over-enthusiastic comment from wrong perspective!).

Regards,