Home > Software engineering >  VB associated Excel
VB associated Excel

Time:06-05

Refer to the Microsoft excel in vb 12.0 object library.
But the runtime displays real-time error 430: class does not support automation or does not support the desired interface,
Procedure is as follows:
Private Sub Command1_Click ()
Dim ExApp As New Excel. Application
Dim Exb As Excel. The Workbook
Dim Exsh As Excel. The Worksheet
Dim arr (2, 100) As an Integer
ExApp. Workbooks. Open "d:/shiyan. XLS"
Dim Partname As Integer
For I=1 To 2
For j=1 To 100
Arr (I, j)=Exsh. Cells (I, j)
Next j
Next I
For k=1 To 100
If (arr (1, k)=Text2. Text) Then
Partname=k
End the If
Next k
Exsh. Cells (2, k)=Text3. Text
ExApp. Workbooks. Close
ExApp. Quit
The Set ExApp=Nothing
End Sub

Errors in ExApp. Workbooks. Open "d:/shiyan. XLS"

CodePudding user response:

According to the Microsoft Data Access Components (MDAC)

CodePudding user response:

D:/shiyan. XLS format into d: \ shiyan XLS
  • Related