+ Reply to Thread
Results 1 to 3 of 3

Error 1004 Program for area of irregular polygon

  1. #1
    Registered User
    Join Date
    10-29-2020
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    9

    Question Error 1004 Program for area of irregular polygon

    Hi guys!
    My program does not work, I was trying to fix it all day but i couldnt find whats wrong. The program should calculate the area of irregular polygon with given coordinates in row (every second column from A is x, every second column from B is y). When i run the program it says "application-defined or object-defined error 1004". If anyone know whats wrong i would really appreciate it. The file is attached.
    Thank you for your help
    Last edited by tzgajner; 12-22-2020 at 03:13 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,603

    Re: Error 1004 Program for area of irregular polygon

    You don't set the value of n until after the section of code where the error is occurring.

    Not sure what n should be to begin with but perhaps you should be setting it's value at the start of the code, before the code causing the problem.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-29-2020
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    9

    Re: Error 1004 Program for area of irregular polygon

    oh thank you, it really works fine now

+ 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. Area of closed polygon (from Autocad to Excel)
    By rajatds31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2020, 09:15 AM
  2. How to draw Irregular Polygon
    By gaului in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2017, 11:19 AM
  3. Run-time Error '1004' Copy and Paste area aren't the same size
    By PleaseHelpMe3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2016, 11:31 AM
  4. Replies: 3
    Last Post: 02-23-2015, 06:51 AM
  5. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  6. Replies: 2
    Last Post: 01-20-2010, 02:47 AM
  7. error 1004 trying to set print area
    By daviddoria in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2009, 02:26 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