اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

تحويل ملفات PDF الي اكسل


النجاشي

الردود الموصى بها

السلام  عليكم ورحمة الله وبركاتة 

اجبتي واستاذتي الكرام 

ممكن كود لتحويل ملفات PDF الي اكسل

تحياتي اليكم احبتي

رابط هذا التعليق
شارك

وعليكم السلام ورحمة الله وبركاته أخي @النجاشي 🙂 

بالاستعانة بالـ ChatGPT .. يوجد هناك كود للتحويل من PDF إلى الأكسل .. 

ولكنه يحتاج لمكتبة وسيطة .. وهي مكتبة ال Adobe Acrobat API  لذلك لازم يكون البرنامج منصب عندك في الجهاز لكي يعمل معاك الكود ..

وهذا هو الكود (لم أجربه) :

Sub ConvertPDFToExcel()
    Dim AcroApp As Object
    Dim AcroAVDoc As Object
    Dim AcroPDDoc As Object
    Dim ExcelApp As Object
    Dim ExcelWorkbook As Object
    Dim ExcelWorksheet As Object
    Dim PDFFilePath As String
    Dim ExcelFilePath As String

    ' Set the file paths for the PDF file and the Excel file
    PDFFilePath = "C:\Path\to\input.pdf"
    ExcelFilePath = "C:\Path\to\output.xlsx"

    ' Create an instance of the Acrobat application
    Set AcroApp = CreateObject("AcroExch.App")

    ' Open the PDF file
    Set AcroAVDoc = CreateObject("AcroExch.AVDoc")
    If AcroAVDoc.Open(PDFFilePath, "") Then
        Set AcroPDDoc = AcroAVDoc.GetPDDoc()

        ' Save the PDF as an Excel file
        AcroPDDoc.SaveAs ExcelFilePath, "com.adobe.acrobat.xlsx"

        ' Close the PDF document
        AcroPDDoc.Close
    End If

    ' Release the Acrobat objects
    Set AcroAVDoc = Nothing
    Set AcroPDDoc = Nothing
    AcroApp.Exit
    Set AcroApp = Nothing

    ' Open the Excel file
    Set ExcelApp = CreateObject("Excel.Application")
    Set ExcelWorkbook = ExcelApp.Workbooks.Open(ExcelFilePath)
    Set ExcelWorksheet = ExcelWorkbook.Sheets(1)

    ' Manipulate the Excel data as needed
    ' ... your code here ...

    ' Close and save the Excel file
    ExcelWorkbook.Close SaveChanges:=True
    ExcelApp.Quit

    ' Release the Excel objects
    Set ExcelWorksheet = Nothing
    Set ExcelWorkbook = Nothing
    Set ExcelApp = Nothing
End Sub

 

ملاحظة من ChatGPT : لاستخدام Adobe Acrobat API ، تحتاج إلى تثبيت Adobe Acrobat على جهازك ، وقد تحتاج إلى إضافة المكتبة "Adobe Acrobat" أو "Adobe Acrobat xx.0 Type Library" في برنامجك. بالإضافة إلى ذلك ، تحتاج إلى التأكد من أن إصدار Adobe Acrobat المثبت على جهازك يدعم استدعاءات ال API . يرجى الرجوع إلى وثائق Adobe Acrobat API للحصول على مزيد من المعلومات حول الطرق المتاحة والإصدارات المدعومة.

  • Like 1
  • Thanks 1
رابط هذا التعليق
شارك

في 15‏/4‏/2023 at 07:59, Moosak said:

وعليكم السلام ورحمة الله وبركاته أخي @النجاشي 🙂 

بالاستعانة بالـ ChatGPT .. يوجد هناك كود للتحويل من PDF إلى الأكسل .. 

ولكنه يحتاج لمكتبة وسيطة .. وهي مكتبة ال Adobe Acrobat API  لذلك لازم يكون البرنامج منصب عندك في الجهاز لكي يعمل معاك الكود ..

وهذا هو الكود (لم أجربه) :

Sub ConvertPDFToExcel()
    Dim AcroApp As Object
    Dim AcroAVDoc As Object
    Dim AcroPDDoc As Object
    Dim ExcelApp As Object
    Dim ExcelWorkbook As Object
    Dim ExcelWorksheet As Object
    Dim PDFFilePath As String
    Dim ExcelFilePath As String

    ' Set the file paths for the PDF file and the Excel file
    PDFFilePath = "C:\Path\to\input.pdf"
    ExcelFilePath = "C:\Path\to\output.xlsx"

    ' Create an instance of the Acrobat application
    Set AcroApp = CreateObject("AcroExch.App")

    ' Open the PDF file
    Set AcroAVDoc = CreateObject("AcroExch.AVDoc")
    If AcroAVDoc.Open(PDFFilePath, "") Then
        Set AcroPDDoc = AcroAVDoc.GetPDDoc()

        ' Save the PDF as an Excel file
        AcroPDDoc.SaveAs ExcelFilePath, "com.adobe.acrobat.xlsx"

        ' Close the PDF document
        AcroPDDoc.Close
    End If

    ' Release the Acrobat objects
    Set AcroAVDoc = Nothing
    Set AcroPDDoc = Nothing
    AcroApp.Exit
    Set AcroApp = Nothing

    ' Open the Excel file
    Set ExcelApp = CreateObject("Excel.Application")
    Set ExcelWorkbook = ExcelApp.Workbooks.Open(ExcelFilePath)
    Set ExcelWorksheet = ExcelWorkbook.Sheets(1)

    ' Manipulate the Excel data as needed
    ' ... your code here ...

    ' Close and save the Excel file
    ExcelWorkbook.Close SaveChanges:=True
    ExcelApp.Quit

    ' Release the Excel objects
    Set ExcelWorksheet = Nothing
    Set ExcelWorkbook = Nothing
    Set ExcelApp = Nothing
End Sub

 

ملاحظة من ChatGPT : لاستخدام Adobe Acrobat API ، تحتاج إلى تثبيت Adobe Acrobat على جهازك ، وقد تحتاج إلى إضافة المكتبة "Adobe Acrobat" أو "Adobe Acrobat xx.0 Type Library" في برنامجك. بالإضافة إلى ذلك ، تحتاج إلى التأكد من أن إصدار Adobe Acrobat المثبت على جهازك يدعم استدعاءات ال API . يرجى الرجوع إلى وثائق Adobe Acrobat API للحصول على مزيد من المعلومات حول الطرق المتاحة والإصدارات المدعومة.

ممكن استاذي موسي تجربه الكود لديك أو مثال مصغر تحياتي اليك يالغالي وكل عام وانت بخير

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information