Importing test content automatically
March 3, 2007 12:00 AM
Hi Pag,If you open up the file using Notepad you'll probably see that for some reason Excel has added a couple of extra "" to each value. If you take out the extra ""s in Notepad, and then save it, it should import into Lectora ok.There are various macros available on the web that can be used to export your worksheet from excel into exactly the format you desire. I've used this one successfully for importing to Lectora: Public Sub OutputQuotedCSV() Const QSTR As String = """" Dim myRecord As Range Dim myField As Range Dim nFileNum As Long Dim sOut As String nFileNum = FreeFile Open "File1.csv" For Output As #nFileNum For Each myRecord In Range("A1:A" & _ Range("A" & Rows.Count).End(xlUp).Row) With myRecord For Each myField In Range(.Cells(1), _ Cells(.Row, 256).End(xlToLeft)) sOut = sOut & "," &QSTR & _ Replace(myField.Text, QSTR, QSTR & QSTR) & QSTR Next myField Print #nFileNum, Mid(sOut, 2) sOut = Empty End With Next myRecord Close #nFileNum End SubEdited By: Mallow76 on 2008-1-15 10:1:3
Discussions have been disabled for this post