Hacemos lo siguiente
1. Abrimos nuestro excel
2. nos vamos a Menú->herramientas -> macro -> editor visual Basic ( otro camino mas fácil presionar Alt + F11)
3. Hacer clic en ver código, si no saben ver la imagen
4. cuando nos salga el espacio para código, pegamos este código tal y como está:
Sub ExtractFlash()
Dim tmpFileName As String
Dim FileNumber As Integer
Dim myFileId As Long
Dim MyFileLen As Long
Dim myIndex As Long
Dim swfFileLen As Long
Dim i As Long
Dim swfArr() As Byte
Dim myArr() As Byte
tmpFileName = Application.GetOpenFilename("MS Office File (*.doc;*.xls;*.ppt), *.doc;*.xls;*.ppt", , "Open MS Office file")
If tmpFileName = "False" Then Exit Sub
myFileId = FreeFile
Open tmpFileName For Binary As #myFileId
MyFileLen = LOF(myFileId)
ReDim myArr(MyFileLen - 1)
Get myFileId, , myArr()
Close myFileId
Application.ScreenUpdating = False
i = 0
Do While i < MyFileLenIf myArr(i) = &H46 ThenIf myArr(i + 1) = &H57 And myArr(i + 2) = &H53 ThenswfFileLen = CLng(&H1000000) * myArr(i + 7) + CLng(&H10000) * myArr(i + 6) + CLng(&H100) * myArr(i + 5) + myArr(i + 4)ReDim swfArr(swfFileLen - 1)For myIndex = 0 To swfFileLen - 1swfArr(myIndex) = myArr(i + myIndex)Next myIndexExit DoElsei = i + 3End IfElsei = i + 1End IfLoopmyFileId = FreeFiletmpFileName = Left(tmpFileName, Len(tmpFileName) - 4) & ".swf"Open tmpFileName For Binary As #myFileIdPut #myFileId, , swfArrClose myFileIdMsgBox "Save the extracted SWF Flash as [ " & tmpFileName & " ]"End Sub
Dim tmpFileName As String
Dim FileNumber As Integer
Dim myFileId As Long
Dim MyFileLen As Long
Dim myIndex As Long
Dim swfFileLen As Long
Dim i As Long
Dim swfArr() As Byte
Dim myArr() As Byte
tmpFileName = Application.GetOpenFilename("MS Office File (*.doc;*.xls;*.ppt), *.doc;*.xls;*.ppt", , "Open MS Office file")
If tmpFileName = "False" Then Exit Sub
myFileId = FreeFile
Open tmpFileName For Binary As #myFileId
MyFileLen = LOF(myFileId)
ReDim myArr(MyFileLen - 1)
Get myFileId, , myArr()
Close myFileId
Application.ScreenUpdating = False
i = 0
Do While i < MyFileLenIf myArr(i) = &H46 ThenIf myArr(i + 1) = &H57 And myArr(i + 2) = &H53 ThenswfFileLen = CLng(&H1000000) * myArr(i + 7) + CLng(&H10000) * myArr(i + 6) + CLng(&H100) * myArr(i + 5) + myArr(i + 4)ReDim swfArr(swfFileLen - 1)For myIndex = 0 To swfFileLen - 1swfArr(myIndex) = myArr(i + myIndex)Next myIndexExit DoElsei = i + 3End IfElsei = i + 1End IfLoopmyFileId = FreeFiletmpFileName = Left(tmpFileName, Len(tmpFileName) - 4) & ".swf"Open tmpFileName For Binary As #myFileIdPut #myFileId, , swfArrClose myFileIdMsgBox "Save the extracted SWF Flash as [ " & tmpFileName & " ]"End Sub
Ver archivo .txt
5. presionar F5 para ejecutarlo o nos vamos a menú ejecutar>Ejecutar Sub/user Form,
6. nos saldrá una ventana de abrir archivo, seleccionamos el archivo doc o xls en done esta incrustado el flash.
7. y seguidamente veremos un mensaje de donde se ha guardado el .swf
ya con esto hemos extraído el archivo a nuestra pc y podemos usarlo en cualquier otro lado.
0 comments:
Post a Comment