Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("d:\abc.xls")
Dim Ws1 As MSExcel.WorkSheet = Wb.WorkSheets("sheet1") '指定要复制的工作表
Dim Ws3 As MSExcel.WorkSheet = Wb.WorkSheets("excel")
Ws1.UsedRange.Copy
ws3.Cells(30, 7).Select
ws3.paste
app.Visible = True
有下面的提示
---------------------------
版本:2022.8.18.1
---------------------------
代码执行出错,错误信息:
System.Runtime.InteropServices.COMException (0x800A03EC): 类 Range 的 Select 方法无效
在 Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
在 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
在 UserCode.Test()
---------------------------
确定
---------------------------
[此贴子已经被作者于2023/3/21 19:40:22编辑过]