Correccion codigo Importar Foto
Publicado por Ignacio (16 intervenciones) el 10/01/2013 09:55:02
Buenas, estoy intentando importar una foto con VB, tengo este codigo pero no me funciona y no se por que, cuando lo aplico se colapsa excel. Seria de gran ayuda si alguien me lo podria corregir... Muchas gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Sub ImportPicture()
Dim row As Long
Dim i As Long
Dim Blatt As Long
Dim picPath As String
Dim Picture As Object
Dim dHeight As Double
Dim dWidth As Double
Dim mylmg As Object
Blatt = 12
Blatt = Blatt * 19 + 32
row 52
On Error Resume Next
While Cells(row, 7) <> ""
picPath = "K:\11PCB\99FAROLEAN\C_Dokumente und Vorlagen\Logo\FAROLEAN_LOGO.jpg" + Cells(row, 7) + "jpg"
Sheets(Hoja2).Select
i = 32
On Error Resume Next
While i <> Blatt
Cells(12, i).Select
Set mylmg = ActiveSheets.Pictures.Insert(picPath)
With mylmg
dWidth = .Width
dHeight = .Height
.Width = 300
.Height = 200
End With
mylmg.Top = ActiveCell.Top
mylmg.Left = ActiveCell.Left
Rows(row).RowHeight = mylmg.Height
i = i + 19
Wend
End Sub
Valora esta pregunta


0