Why is step into function is working but play has error in VBA?

Eliza O. Riva 0 Reputation points
2025-06-24T08:52:39.8433333+00:00

I have a macro that converts PDF file into excel. For the first file, it works properly not until I encountered this error on the succeeding files:

User's image

When I tried to check step into, the macro runs smoothly and converts all the PDF files to excel. While Run/Debug has this error. Please help me with this. Thank you!

Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hin-V 740 Reputation points Microsoft External Staff Moderator
    2025-06-24T13:23:52.0166667+00:00

    Dear @Eliza O. Riva   

    Thank you for posting your question in the Microsoft Q&A forum.   

    According to your issue, I understand that you have received the Run time Error 1004 in Microsoft Excel. Please try the following suggestions first to see if they help you: 

    • Delete the GWXL97.XLA Files to Fix Runtime Error 1004 in Excel 

    The easiest method to fix the Excel error 1004 is to find and delete the error file. 

    1. Go to C:\Program Files\MS Office\Office\XLSTART. 
    2. Find GWXL97.XLA file and delete it. 
    3. Reopen your Excel file and check if the problem is solved. 

     

    • Check the Trust Access to the VBA Project Object Model 

    Another solution you can try is to enable a VBA project trust option in Excel Trust Center. Follow the detailed steps and have a try. 

    1.Open a blank Excel file and click "Files" on the upper left. 

    2.Click Option and go to Trust Center. 

    undefined

    3.Find and enter the Trust Center Settings. 

    undefined

    4.Under Macro Settings, tick the option of "Trust access to the VBA project object model." 

    undefined

    Then you can try to test it again. 

    If you need further assistance, please let us know.  


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.