+ Reply to Thread
Results 1 to 3 of 3

VBA Error "Automation Error Exception Occured"

  1. #1
    Registered User
    Join Date
    07-18-2024
    Location
    United States
    MS-Off Ver
    MS 365
    Posts
    30

    Question VBA Error "Automation Error Exception Occured"

    I made a VBA Macro that will be below. I have been using the VBA for the past few days on a file that contains 11 different sheets. The VBA is taking the text in one sheet and trying to find similar text in another sheet. The program requires user input on what row to start the search for both sheets, which sheets to look at, and which columns to look at. I then have a form button to activate the macro as I was just to dumb to figure out how to use the activex button. I can't post the file itself for confidentiality reasons. To put my issue simply, there are certain columns I have been using the program to compare that are significantly "longer" than other columns, it has a lot more text (usually between 200and 800 characters). When I use the program to run this code it works fine for the longer text and it typically works fine for the shorter columns when I compare those. However for some reason 1 specific combination of the shorter comparisons breaks the program every time. For the life of me I can't figure out what is causing the problem. And yes before anyone asks, my coding isn't pretty, but it usually works so ¯\_(ツ)_/¯

    What I've tried
    Stepping through code: My god it takes so long based on how the program runs but no issues when I do that
    Going into VBA and hitting run: Works, issue seems to only occur when I hit the form button
    Checking references in tools: Everything seems to be there

    Please Login or Register  to view this content.
    any ideas on what could be causing the issue?

  2. #2
    Registered User
    Join Date
    07-18-2024
    Location
    United States
    MS-Off Ver
    MS 365
    Posts
    30

    Re: VBA Error "Automation Error Exception Occured"

    Some more information that I realize I left out. The program normally took 30 seconds to a few minutes based on the length of the strings and the amount of rows. When the program runs now, some combinations of sheets and columns makes the program freeze and the error code comes when I try to just close excel.

    I did notice the bad range.delete call out and fixed it.

    Some of these combinations im trying worked as late as this morning, but an IT ticket forced my computer to restart and now I am getting these issues.
    Last edited by MDLovitt; 07-25-2024 at 05:56 PM.

  3. #3
    Registered User
    Join Date
    07-18-2024
    Location
    United States
    MS-Off Ver
    MS 365
    Posts
    30

    Re: VBA Error "Automation Error Exception Occured"

    Through a lot of testing ive found the cells that make the program "break" and ive tested those cells in separate sheets. the program works just find when I compare those cells to each other in separate sheets that I create with just the problem cells. I cant figure out why the program can compare these cells just fine when they are isolated but it cant compare them while they are inside their original sheets.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What does "Exception Occured" Mean?
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2020, 10:48 AM
  2. Solver - Automation Error Exception Occured
    By godonnell06 in forum Excel General
    Replies: 5
    Last Post: 03-23-2016, 04:43 AM
  3. [SOLVED] Error when VBA tries to use Adobe "Automation Error -object disconnected from clients"
    By scottiex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2016, 10:20 PM
  4. [SOLVED] "Exception Occured" Message
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2015, 09:07 AM
  5. MS Excel w/ userform & macros - Receive "Automation error Exception ocurred" message
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2014, 01:54 AM
  6. Replies: 5
    Last Post: 10-08-2013, 04:33 PM
  7. [SOLVED] AN exception has occured error
    By djsouljah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2013, 03:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1