Cordial Saludo;
Me encuentro exportando unas graficas desde excel a word, para lo cual se
esta utilizando el siguiente codigo:
'********************
'Graficas San Carlos
'********************
'Macro para exportar grafica Generacion Central San Carlos
Sub Exportar_Generacion_SCR()
Dim x As Excel.Application
Dim Y As Excel.Workbook
Dim problems As Boolean
On Error Resume Next
Set x = GetObject(, "Excel.Application")
If Err Then
problems = True
Set x = New Excel.Application
End If
On Error GoTo 0
Set Y = x.Workbooks.Open _
("\\Genmdt04\ingenieria\plantillainformesmensuales\SAN CARLOS\Grafica
Informe Mensual San Carlos.xls")
With Y
.Sheets("Generacion").Select
.ActiveSheet.ChartObjects("Gráfico 1").Activate
.ActiveChart.ChartArea.Select
.ActiveChart.ChartArea.Copy
End With
On Error Resume Next
ActiveDocument.Unprotect ("111")
With Selection
.GoTo What:=wdGoToBookmark, Name:="Grafica_Generacion_SCR"
.MoveLeft Unit:=wdCharacter, Count:=1
.MoveRight Unit:=wdCharacter, Count:=1
.PasteAndFormat Type:=wdChartPicture
End With
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True, Password:="111"
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Y.Close SaveChanges:=False
x.Quit
Set Y = Nothing: Set x = Nothing
End Sub
La libreria Microsoft Excel 11.0 Object Library se encuentra activa, pero me
presenta el siguiente error:
http://img401.imageshack.us/img401/...rorkh2.jpg
No entiendo que es lo que puede suceder, por que al trabajar en mi
computador, funciona correctamente, pero al probarla en otra direccion, sale
el error mencionado.
Si es posible que me colaboren a buscar la causa del problema, les estaria
muy agradecido.
Cordialmente;
Jorge.
Leer las respuestas