CreateOleObject errors

CreateOleObject errors

My completed Delphi application exports Quick Reports to Excel. This operation is 99.5 percent successful, and users are delighted. I am one of the developers, and one of the .5 percent. Before the app was released, my peer developers decided the problem was my machine (a Dell). The .5 percent of the users are screaming. I need to know why it isn’t working for some of us so that I can fix it right away.

The code is written with TRY/FINALLY and is failing within the CreateOleObject(‘Excel.Application’). I want to be able to capture the exact error# and description so I can correct it.

The answer to this question is not specifically geared towards the OleObjectError message. It’s a more generic technique that can be applied to various exceptions that arise in Delphi programs.

There’s no “easy” way to figure out error messages before they actually occur. In fact, for handling errors, you won’t know what to handle until you see what the darn message isin the debugger! So follow the steps below. Once you do, you’ll be able to at least get an errormessage you can use.

  1. Open up the code in the IDE
  2. Change the finally in your try..finally..end to “except.” This’ll raise an exception when it occurs.
  3. Run the program and get to the exception. You should get a message box that tells you the exception class. Write the exception down, or at least remember what it is.
  4. Break out of the program and reboot if you have to.
  5. Go back to the source code in the IDE and change the except in your try block to the following:
    try     …some stuff   except on ExceptVar:      with ExceptVar do        ShowMessage(Message);   end;
    This will tell you what error message was generated with the exception, andhopefully tell you what’s going on with your application when it tries toestablish an OLE conversation.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes