|
本帖最后由 youngkqs 于 2018-9-22 11:29 编辑
各位大神好,我想调用草料二维码的二维码。代码如下,但是调用之后,总是空白的。
草料二维码接口地址:https://cli.im/api/
材料二维码网址:https://cli.im/
- Sub 生成二维码()
- Dim r As String
- Dim RngY As Range
- Set RngY = Range("B" & 1)
- r = 生成二维码Fun(Range("A" & 1) & "20180922", RngY)
- Range("A1").Select
- End Sub
- Function 生成二维码Fun(ByVal Str As String, ByVal Rng As Range)
- 批量删除条码
- Dim i%, str1$, str2$, str3$, D As Object
- Set D = New DataObject
- Application.ScreenUpdating = False
- str1 = "<table><img src=""https://cli.im/api/qrcode/code?text="
- str2 = "&mhid=sELPDFnok80gPHovKdI"" > "
- str3 = str3 & str1 & Str & str2 & Chr(10)
- D.SetText str3
- D.PutInClipboard
- Rng.Select
- ActiveSheet.PasteSpecial Format:="Unicode 文本", Link:=False, DisplayAsIcon:=False
- Selection.ShapeRange.Height = 42
- Application.ScreenUpdating = True
- End Function
- Sub 批量删除条码()
- Dim myshape As Shape
- Application.ScreenUpdating = False
- For Each myshape In ActiveSheet.Shapes
- If myshape.Type = msoPicture Then
- myshape.Delete
- End If
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|