How to get EXIF ​​information from a picture on an Excel worksheet using VBA

How to get EXIF ​​information, such as Latitude, Longitude, etc., from a form drawing on an Excel worksheet using VBA? And is it possible to get it without extracting or copying an image from a worksheet or from a stuck Excel workbook?

I can iterate through the contents of the zipped folder using the following code.

Public Sub ReadZip()
    Dim vZipFileName As Variant
    vZipFileName = "C:\Users\erogrou\Desktop\Test.zip"

    Dim objShell, objFolder
    Set objShell = CreateObject("shell.application")
    Set objFolder = objShell.Namespace(vZipFileName)

    Dim vFilename As Variant

    If (Not objFolder Is Nothing) Then
        Debug.Print objFolder.self.Path

        For Each vFilename In objFolder.items
            Debug.Print vFilename
        Next

    End If

    Set objFolder = Nothing
    Set objShell = Nothing

End Sub
+4
source share
2 answers

Luckily for you there is the beautiful coding part of Andrew Phillips of the North North Catchment Management Authority from Australia that does just that.

It is provided as a class module, so I have not looked for renaming this here.

Access Excel, 32 64 :

VirtualAlloc Lib "kernel32" (ByVal Address As Long, ByVal Size As Long, ByVal AllocationType As Long, ByVal Protect As Long) As Long

PntSafe

PtrSafe VirtualAlloc Lib "kernel32" (ByVal Address As Long, ByVal Size As Long, ByVal AllocationType As Long, ByVal Protect As Long) As Long

+3

Excel (EMF). EMF, EMF JPG, EXIF ​​ JPG.

, Excel XLSX/XLSM, JPG XLSX/XLSM EXIF.

, .NET.

+2

Source: https://habr.com/ru/post/1674627/


All Articles