VB 操作ole excel 控件 输入数据后如何保存

如图,我已经在第二列输入了东西,也已经把ole1 与c:\123.xlsx关联起来了,输入完成后怎么保存数据呢?我打开c:\123.xlsx一直是空的。

问题2:OLE1.object.Sheets("Sheet1").Cells(2, 2).Value = 1234,为什么运行后直接跳过去了,没在ole1当中显示?
3:
If OLE1.object.Sheets("Sheet1").Cells(1, 2).Value = "桩号" Then
MsgBox "123"
Exit Sub
End If
OLE1.object.Sheets("Sheet1").Cells(2, 2).Value = 1234
If OLE1.object.Sheets("Sheet1").Cells(2, 2).Value = "" Then
MsgBox "请输入要查询的桩号"
Exit Sub
End If
这几句都被跳过去了,但是Text20.Text = OLE1.object.Sheets(1).Cells(1, 1)执行了,这是为什么?

第1个回答  2014-08-22
vb及excel问题解决
相似回答
大家正在搜