+ Reply to Thread
Results 1 to 3 of 3

Runtime error with .OnAction if there's a comment somewhere in the sheet

  1. #1
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Runtime error with .OnAction if there's a comment somewhere in the sheet

    Hi,

    it's me again. I ran into what could be one of the last major issues before finishing my project. Here it comes, I hope you help me find the mistake again.

    For some cells in my worksheet, I would like insert a comment. Works perfectly fine using the following code in the Form_ScoringFunctionInput within the attached workbook (coding style is not the best, sorry).
    Please Login or Register  to view this content.
    However, if I activate another sub which adds a shape in the same row but different cell (module "PublicVariablesAndFunctions") using
    Please Login or Register  to view this content.
    The error code I'm getting is the great runtime error 1004 and the .OnAction line is highlighted. If no comment is in the sheet, everything works perfectly fine. I just can't get my head around how the comments and the shapes are related? Do you have an idea?

    If you would like to reproduce the error yourselves using the xlsm, here's a guide
    - click on a "click to select a scoring function" shape of your choice.
    - pick any, doesn't matter. "Next" and choose "automated scoring" (this leads to the creation of comments), lowest input e.g. 0, desired input e.g. 1, leave unit empty (these values don't really matter).
    - click on "add decision factor or criterion" button, add a random title, choose "decision criterion" and any superior factor.
    Violà, you have the error.

    Edit: Attachment removed as I do not wish to have it publicly available permanently.
    Last edited by Menohavename; 03-25-2020 at 09:59 AM.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Runtime error with .OnAction if there's a comment somewhere in the sheet

    Just unlucky probably; Excel has decided to add your shape before the comment. How about changing this line:

    Please Login or Register  to view this content.
    To this:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Re: Runtime error with .OnAction if there's a comment somewhere in the sheet

    I spent hours on that problem and now such a simple solution. This does the trick perfectly, thank you so much!
    Last edited by Menohavename; 03-25-2020 at 10:46 AM.

+ 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. [SOLVED] Help with Unable to set the OnAction property of the Button class error
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2019, 01:49 PM
  2. [SOLVED] Automatically Extract comment/data from Sheet 1 to populate Sheet 2
    By nadagoat83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2014, 08:07 AM
  3. [SOLVED] Run-time error 91 when using ActiveCell.Comment
    By Shanthan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2013, 08:42 PM
  4. Disable Delete Comment, Edit Comment, Show/Hide Comment
    By Shanthan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2013, 06:12 AM
  5. Copy Data from one Sheet to Another Sheet including comment and formats
    By SubhasreeM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2012, 07:07 AM
  6. [SOLVED] Return comment to master sheet after matching to source sheet name and cell number
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2012, 05:09 PM
  7. Runtime error '1004' Application-defined or object-defined error Comment
    By Willer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 03:02 PM

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