彰化一整天的論壇

 找回密碼
 立即註冊
查看: 784|回復: 0

Excel產生barcode

[複製鏈接]
發表於 2016-10-6 13:10:55 | 顯示全部樓層 |閱讀模式
https://strokescribe.com/en/crea ... 3-2016-activex.html

  1. StrokeScribe1.Alphabet = DATAMATRIX
  2. Dim data As String
  3. data = ActiveSheet.Cells(1, 1)
  4. StrokeScribe1.Text = data
  5. If StrokeScribe1.Error Then
  6.    MsgBox StrokeScribe1.ErrorDescription
  7. End If
複製代碼
  1. Dim wsh As Worksheet
  2. Set wsh = Excel.ActiveSheet    'or Excel.Worksheets("Sheet2") if you need to address a worksheet by it's name

  3. Dim rng As Range
  4. Set rng = wsh.Range("C5")   'or wsh.Cells(5, 3)

  5. rng.Font.Name = "StrokeScribe 1D"
  6. rng.Font.Size = 12 'For 203 DPI thermal label printers, use 12/18pt fonts.
  7.   
  8. Dim ssc As StrokeScribeClass
  9. Set ssc = CreateObject("STROKESCRIBE.StrokeScribeClass.1")
  10.   
  11. ssc.Alphabet = CODE128   'or EAN13 or UPCA or I2OF5

  12. ssc.Text = "123" & Chr(9) & "ABC"   'use the Chr() function to encode ASCII control characters in the barcode
  13. If ssc.Error Then
  14.   MsgBox ssc.ErrorDescription
  15.   Exit Sub
  16. End If
複製代碼
https://strokescribe.com/en/create-barcode-excel-2007-2010-2013-2016-activex.html
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

 ㄚ母滴雞湯
 員林香純滴雞精

Archiver|手機版|小黑屋|彰化一整天的論壇(Excel,Office)  |网站地图

GMT+8, 2019-10-16 20:42 , Processed in 0.124252 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表