Excel 条形码生成(BarCode)

来源:互联网 发布:matlab矩阵归一化 编辑:程序博客网 时间:2024/04/30 20:22
    '**********************************************************************    ' @(f)    '    '機能  : バーコードを作成    '    '返り値 :    '    '引き数 :     '                  '機能説明:    '    '備考  :    '    '**********************************************************************    Private Function PF_CreateBarcode(ByVal ExcelUtil_eu As ExcelUtil, ByVal CurrentCell As String, ByVal Top_i As Integer, ByVal left_i As Integer)        ExcelUtil_eu.m_xApp.ScreenUpdating = False        ExcelUtil_eu.m_xApp.Calculation = Excel.XlCalculation.xlCalculationManual        ExcelUtil_eu.m_xApp.Interactive = False        System.Windows.Forms.Application.DoEvents()        ExcelUtil_eu.m_xSheet.OLEObjects.Add(ClassType:="BARCODE.BarcodeCtrl.1", Link:=True, _                                               DisplayAsIcon:=False, Width:=200, Height:=250, Top:=Top_i, _                                               Left:=left_i)        Dim MyBarcode As String        Dim objBarCode As BARCODELib.BarCodeCtrl        MyBarcode = ExcelUtil_eu.m_xSheet.Shapes.Item(ExcelUtil_eu.m_xSheet.Shapes.Count).Name        Dim ole As Excel.OLEObject        ole = ExcelUtil_eu.m_xSheet.OLEObjects(MyBarcode)        With ole            .AutoLoad = True            .PrintObject = True            .Visible = False            .Placement = 2            .LinkedCell = CurrentCell            .Visible = True        End With        objBarCode = ole.Object        With objBarCode            .Style = 5          ' 5:NW-7            .SubStyle = 0            .Validation = 0     ' C/D修正有り            .ShowData = 1       ' 数値表示            .Value = "a" & ExcelUtil_eu.m_xSheet.Range(CurrentCell).Value & "a"            .Refresh()        End With        ExcelUtil_eu.m_xSheet.m_xApp.Interactive = True        ExcelUtil_eu.m_xSheet.m_xApp.Calculation = Excel.XlCalculation.xlCalculationAutomatic        ExcelUtil_eu.m_xSheet.m_xApp.ScreenUpdating = True    End Function
 本博版权所有!转载注明出处!
原创粉丝点击