Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two columns as key/value pairs and want to export them to a file in the structure key=value (to create a properties file).

I tried this script:

Sub Properties()
Dim FileName As String, i As Integer, str As String

FileName = "C:\propstest.txt"

Open FileName For Output As #1

For i = 1 To 50
str = cells(i, 1) & "=" & cells(i, 2)
Write #1, str
Next i
Close #1

End Sub

It almost works but it prints to the file like


Is there a way to get rid of the quotation marks in the file?


share|improve this question
up vote 4 down vote accepted

Using WriteLine instead of Write should get rid of the quotation marks.

share|improve this answer
I ended up changing the Write to Print and it worked. I think your way would have worked too, but I would have had to change more. – jmcmahon May 12 '11 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .