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?
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
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.
 
Joined
Dec 16, 2009
Messages
3
Reaction score
0
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!
 
Joined
Dec 16, 2009
Messages
3
Reaction score
0
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!
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Glad you've got it working, and a big thanks for posting back with the solution :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top