Home > Software engineering >  Vb6 how to operate the already open excel, and not to open the operation again
Vb6 how to operate the already open excel, and not to open the operation again

Time:09-28

I made a small program, it is in the operation of the excel table opens, but to the excel, but every time need to use the open to open, not to open the source file, could you tell me how to not open again, only to the existing open excel, such as modifying existing open excel, the value of a single cell, thanks.

CodePudding user response:

Add reference to excel, and then refer to the following code:
 Private Sub Command1_Click () 
Dim mExcel As Excel. Application
The Set mExcel=GetObject (, "excel. Application")
MExcel. ActiveCell. Value="https://bbs.csdn.net/topics/sfsiof"
The Set mExcel=Nothing
End Sub


CodePudding user response:

GetObject, if an error, use CreateObject create a,
  • Related