Excel 2010 non incorpora le immagini

di il
2 risposte

Excel 2010 non incorpora le immagini

Ciao a tutti,

da un db access ho il seguente codice che estrae dei record in un file xls comprensivi di immagini

----------------------
sPath = "C:\miopercorso\"
'creo l'oggetto Excel
Set objExcel = CreateObject("Excel.Application")
'apro e metto un riferimento ai workbook tuoFile.xls
Set objWorkbook1 = objExcel.Workbooks.Open(sPath & "tuofile.xlsx")
'metto un riferimento al Foglio1 del workbook tuoFile.xls
Set objWorksheet1 = objWorkbook1.WorkSheets("Foglio1")
'rendo visibile Excel(se serve)
objExcel.Visible = True
With objWorksheet1
'.Unprotect password:="Pippo"
objWorksheet1.Cells(1, 2) = Me.Intestazione
objWorksheet1.Cells(4, 4) = "Ordine del " & Format$(Now(), "dd/mm/yyyy hh:mm:ss") & " --- Destinazione: " & Me.Testo99
objWorksheet1.Cells(1, 6) = "Cliente: " & Me.CLIENTE
objWorksheet1.Cells(2, 6) = "Indirizzo: " & Me.Testo25
objWorksheet1.Cells(3, 6) = "Città: " & Me.Testo27
For i = 1 To Me.RecordsetClone.RecordCount
xxx = Me.Percorso
objWorksheet1.Rows(i + 5).RowHeight = 100
.Range(.Cells(5 + i, 1), .Cells(5 + i, 16)).Borders.LineStyle = 7
'objExcel.ScreenUpdating = False
.Pictures.insert(xxx).Select
.shapes(i).Top = .Range("B" & 5 + i).Top
.shapes(i).Left = .Range("B" & 1 + i).Left
.shapes(i).Width = 100
.shapes(i).Height = 100
.shapes(i).Locked = True
objWorksheet1.Cells(5 + i, 1) = i
objWorksheet1.Cells(5 + i, 3) = Me.ARTICOLO
objWorksheet1.Cells(5 + i, 4) = Me.CODART
objWorksheet1.Cells(5 + i, 5) = "=myean13(Left(" & Me.CODART & ", Len(" & Me.CODART & ") - 1))"
objWorksheet1.Cells(5 + i, 6) = Me.DESCRIZION
objWorksheet1.Cells(5 + i, 7) = Me.colli
objWorksheet1.Cells(5 + i, = Me.IMBALLO
objWorksheet1.Cells(5 + i, 9) = Me.IMBALLO * Me.colli
objWorksheet1.Cells(5 + i, 10) = Me.PREZZO
objWorksheet1.Cells(5 + i, 11) = Me.sr1
objWorksheet1.Cells(5 + i, 12) = Me.sr2
objWorksheet1.Cells(5 + i, 13) = Me.sr3
objWorksheet1.Cells(5 + i, 14) = Me.DISPONIBIL
objWorksheet1.Cells(5 + i, 15) = Me.PrimoArr
objWorksheet1.Cells(5 + i, 16) = Me.ORDINABILI
.Range(.Cells(5 + i, 1), .Cells(5 + i, 16)).Locked = True
If i = Me.RecordsetClone.RecordCount Then
Else
DoCmd.GoToRecord , , acNext
DoEvents
End If
Next i

End With
'salvo le modifiche
objWorkbook1.Saveas Me.NOMEFILE & "_catalogo.xlsm"
'chiudo il workbook
objWorkbook1.Close
RigaChiusura:
'chiudo Excel
objExcel.Quit
'Set a Nothing dei vari oggetti
Set objWorksheet1 = Nothing
Set objWorkbook1 = Nothing
Set objExcel = Nothing
---------------------


funziona regolarmente, in excel 2007 mi crea il file con le immagini incorporate (come dovrebbe essere) ma in excel 2010 (non ho provato sulle versioni successive) le collega soltanto tant'è che inviando il file xls ai destinatari non vedono le immagini ma un riquadro che indica che il file di origine è mancante, si vedono solo sui pc che hanno le immagini nella directory di origine...

ho smanettato tu tutte le impostazioni di excel 2010 senza trovare soluzioni... voi che mi dite?


Grazie

Nico

2 Risposte

Devi accedere o registrarti per scrivere nel forum
2 risposte