有一个按钮下写的代码点击保存工作簿内容到txt文件
代码:
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
工作簿中的原始行:
create table abc as select rpt2_id, rpt2_usgcount, rpt2_usgdate, rpt2_usgmins from rpt2 where rpt2_id = 'xyz;
输出如下:
"create table abc as select rpt2_id, rpt2_usgcount, rpt2_usgdate, rpt2_usgmins from rpt2 where rpt2_id = 'xyz;"
您的输出在开始和结束时带有双引号,并且仅用于工作簿中存在的插入和创建语句。
谁能帮我不要在输出中得到那个引号。?