Excel VB6 - Excel Text to Notepad

Joined
Dec 16, 2009
Messages
3
Reaction score
0
We're working on writing a script in Excel using variables from the spreadsheet that ultimately gets saved as a notepad file to be used with another macro program (AutoHotKeys). The problem i'm having is that anytime a line includes a comma, the string is included in quotation marks when it hits notepad.

Range("A121").Value = "click 588, 386"

...
the file then gets saved as directly to the new format:

ActiveWorkbook.SaveAs Filename:="F:\AutoHotkey\LoadTest.ahk", _
FileFormat:=xlCurrentPlatformText, CreateBackup:=False


And the line appears with quotation marks. I need it to read just: click 588, 386.

Any suggestions?
 
I did a bit more digging and think that this is what you are after. You need to scroll all the way to the bottom of this page in Googles cache to see the solution for some reason.
 
I believe the sub routine "ExportSheetAsTextWithoutQuotes" should work for me, but I'm having trouble calling it. Compiler is expecting " = " after the expression and I'm not sure what its looking for.




Public Sub ExportSheetAsTextWithoutQuotes( _
ByVal SourceSheet As Worksheet, _
ByVal FilePath As String _
)

Thanks for your help so far!
 
Just figured it out. All I needed to do was change the file format to xlTextPrinter



ActiveWorkbook.SaveAs Filename:="F:\AutoHotkey\LoadTest.ahk", _
FileFormat:=xlTextPrinter, CreateBackup:=False

Thanks again!
 
Glad you've got it working, and a big thanks for posting back with the solution :)
 
Back
Top