There is a code written under a button click to save the workbook content to a txt file
Code:
Private Sub CommandButton1_Click()
Dim xlApp As Object
Dim xlBook As Object
Dim xlSheet As Object
Dim strOutputFileName
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("C:\Documents and Settings\bera02a\Desktop\Arun_TAT_Testing_orig_14022013.xls")
For Each xlSheet In xlBook.Worksheets
strOutputFileName = "C:\Documents and Settings\bera02a\Desktop\" & xlSheet.Name & ".txt"
xlSheet.SaveAs Filename:=strOutputFileName, FileFormat:=xlUnicodeText
Next
xlApp.Quit
End Sub
Original line in workbook:
create table abc as select rpt2_id, rpt2_usgcount, rpt2_usgdate, rpt2_usgmins from rpt2 where rpt2_id = 'xyz;
Output is coming as:
"create table abc as select rpt2_id, rpt2_usgcount, rpt2_usgdate, rpt2_usgmins from rpt2 where rpt2_id = 'xyz;"
Thee output is coming with double quotes at the start and end and it is only coming for the insert and create statements present in the workbook.
Can anyone help me in not getting that quotes in the output.?