Home > Software engineering >  VB6 extracted Excel pictures, extract the picture can't display
VB6 extracted Excel pictures, extract the picture can't display

Time:09-16

With the following command from the extracted Excel pictures, not all pictures, pictures of every time does not display the number is different also, directly, thank you,

Dim xlApp As Excel. Application
Dim xlBook As Excel. The Workbook
Dim xlSheet As Excel. The Worksheet

The Set xlApp=CreateObject (" Excel. Application ")
XlApp. Visible=True
Dim a (1 To 6) As String
Dim b (1 To 20) As String
Dim n As Integer
A (1)="1-1
"A (2)="1 to 2
"A (3)="2-1
"A (4)="2-2"
A (5)="3-1
"A (6)="3-2"
B (1)="0001"
B (2)="0002"
B (3)="0003"
B (4)="0004"
B (5)="0005"
B (6)="0006"
B (7)="0007"
B (8)="0008"
(9) b="0009"
B (10)="0010"
B (11)="0011"
B (12)="0012"
N=1
For j=1 To 12
For I=1 To 6
The Set xlBook=xlApp. Workbooks. Open (" C: \ Users \ HG \ Desktop \ Temp1 \ "& amp; B (I) & amp; "" & amp; A (I))
The Set xlSheet=xlBook. Worksheets (1)
XlSheet. Activate
The Clipboard. The Clear
XlSheet. Shapes (1) Copy

Image1. Picture=Clipboard. GetData
SavePicture Image1, "C: \ Users \ HG \ Desktop \ Temp2 " & amp; N & amp; ". JPG "
N=n + 1
XlBook. Close
XlApp. Quit
Next I
Next j

XlApp. Quit
The Set xlSheet=Nothing
The Set xlBook=Nothing

End Sub

CodePudding user response:

The contents of the clipboard is image, and is JPG of all kinds,
With the hex editor such as application ultraedit open to confirm,

CodePudding user response:

Please consult I read: https://blog.csdn.net/chenjl1031/article/details/8879704
  • Related