Try using the first snippet. Add a reference to Excel, and replace the debug statement with a write to file. Or, you could wrap it in a function and have it return the vValue variable.

A search of the forum should give you all the info you need on writing the text file.

I don't have VB installed on this machine, or I could be more explicit.