Extraer archivo swf

02/06/2009 - 02:42 por Alexa | Informe spam
Trabajo con Office 2007 ¿como debo hacer para extraer un archivo swf
incrustado en un archivo xls ?
 

Leer las respuestas

#1 Héctor Miguel
02/06/2009 - 06:31 | Informe spam
hola, Alexa !

Trabajo con Office 2007 como debo hacer para extraer un archivo swf incrustado en un archivo xls ?



el siguiente codigo proviene de un foro de excel en chino (nunca lo he probado)
(aparentemente) el archivo .xls debe ser de version anterior a 2007
y debes seleccionarlo (SIN abrirlo) en el dialogo que muestra la misma macro

si cualquier duda (o informacion adicional)... comentas ?
saludos,
hector.

nota: OJO con los saltos de linea segun tu lector de noticias...

Sub ExtraerFlash()
Dim Nombre_tmp As String, IdArchivo As Long, LargoArchivo As Long, Pos As Long, _
Largo_swf As Long, n As Long, Matriz_swf() As Byte, Matriz_x() As Byte
Nombre_tmp = Application.GetOpenFilename( _
"Archivos MS Office (*.doc;*.xls), *.doc;*.xls", , "Abrir Archivos Word / Excel")
If Nombre_tmp = "False" Then Exit Sub Else Application.ScreenUpdating = False
IdArchivo = FreeFile: Open Nombre_tmp For Binary As #IdArchivo: LargoArchivo = LOF(IdArchivo)
ReDim Matriz_x(LargoArchivo - 1): Get IdArchivo, , Matriz_x(): Close IdArchivo
Do While n < LargoArchivo
If Matriz_x(n) = &H46 Then
If Matriz_x(n + 1) = &H57 And Matriz_x(n + 2) = &H53 Then
Largo_swf = CLng(&H1000000) * Matriz_x(n + 7) + _
CLng(&H10000) * Matriz_x(n + 6) + _
CLng(&H100) * Matriz_x(n + 5) + _
Matriz_x(n + 4)
ReDim Matriz_swf(Largo_swf - 1)
For Pos = 0 To Largo_swf - 1: Matriz_swf(Pos) = Matriz_x(n + Pos): Next: Exit Do
Else: n = n + 3
End If
Else: n = n + 1
End If
Loop: Nombre_tmp = Left(Nombre_tmp, Len(Nombre_tmp) - 4) & ".swf": IdArchivo = FreeFile
Open Nombre_tmp For Binary As #IdArchivo: Put #IdArchivo, , Matriz_swf: Close IdArchivo
MsgBox "El archivo Flash-SWF ha sido extraido y guardado como: " & Nombre_tmp
End Sub

Preguntas similares