5,172
社区成员




Function BAR_CODE(codeValue)
Dim vtrue
Dim barObj
If IsEmpty(codeValue) Then
Exit Function
End If
If TypeName(codeValue) = "Range" Then
vtrue = codeValue.Value
Else
vtrue = codeValue
End If
//call insertBarCode
With ActiveSheet
Set tmp = .OLEObjects.Add(ClassType:="BARCODE.BarCodeCtrl.1")
With tmp
.Object.Style = 7
.Object.Value = "11234325"
.Width = 100
.Height = 50
.Top = 10
.Left = 10
End With
End With
If TypeName(barObj) = "Object" Then
With barObj
.Object.Style = 7
.Object.Value = "11234325"
.Width = 100
.Height = 50
.Top = 10
.Left = 10
End With
End If
End Function
Sub insertBarCode()
With ActiveSheet
Set tmp = .OLEObjects.Add(ClassType:="BARCODE.BarCodeCtrl.1")
With tmp
.Object.Style = 7
.Object.Value = "11234325"
.Width = 100
.Height = 50
.Top = 10
.Left = 10
End With
End With
End Sub