|
|
在网上搜索到excel的选择性粘贴的语句,但貌似不能用
AWB.ActiveSheet.Cells.PasteSpecial Paste:=xlValues
这句是选择性粘贴的语句吧......
那我这样用可以不?
--------------------------------------------------------------
Set oWord = CreateObject("Word.Application")
oWord.Visible = False
Set objDoc = oWord.Documents.Open("c:\aa.doc")
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
Set oWb = oExcel.Workbooks.Open("C:\aa.xls")
Set xlsheet = oExcel.Worksheets("sheet1")
oWord.ActiveDocument.Tables(3).Cell(3,3).Select
oWord.Selection.Copy
xlsheet.Cells(1,1).PasteSpecial Paste:=xlValues
( 运行后上面这句提示 “缺少语句”,请问哪里出错了)
oWord.Quit
Set oWord = Nothing
Set objDoc = Nothing
Set fso = Nothing
Set oread = Nothing
Set oExcel = Nothing
Set oWb = Nothing
Set xlsheet = Nothing
--------------------------------------------------------------------------------------
我的目的就是想把aa.doc中的表格里的信息提取到aa.xls中,
如果使用 xlsheet.Cells(1,1).PasteSpecial正常,可以复制粘贴,但把word中的一个单元格都复制进来了,所以就想用excel的选择性粘贴来粘贴上文本。
就指点。。。 |
|