源程序:
sub dealwithtables()
dim h as new word.application
dim celnum as integer
dim rmcount as integer
rmcount=3
h.documents.open ""     '打开一个表格文档
 celnum = 0
 
    celnum = h.ActiveDocument.Tables(1).Columns(1).Cells.count
      
      h.ActiveDocument.Tables(1).Columns(1).Cells(celnum).Range.Select
      h.Selection.MoveUp Unit:=wdLine, count:=(rmcount - 1), Extend:=wdExtend
      h.Selection.Delete
      h.ActiveDocument.Tables(1).Columns(1).Cells(celnum).Range.Select
      h.Selection.MoveUp Unit:=wdLine, count:=(rmcount), Extend:=wdExtend
      h.Selection.Cells.Merge
      rmcount = 0
h.activedocument.save
h.activedocument.close
end sub
上述程序在Word的宏中运行不会出现错误,但是我把它放在vb程序中的时候,提示自动化错误。
哪位高手能够帮忙解决一下?80分酬谢!