Results 1 to 5 of 5

Thread: vba issue

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2019
    Posts
    57

    vba issue

    ello everyone,

    First of all, I hope everyone is safe and healthy. I have a code written in VBA that runs in the ArcGIS environment (GEPIC). The code is linked with an executable file (EPIC.exe). During the executable run, the results are written in text files. The issue is that the executable run stops before all the results are written in text files. It does not display any message. A part of the code is attached. Thank you all in advance.

    in line 42, 43, the original code format was
    Dim i As Long
    Dim X, Y As Single

    I have changed both dimensions as Double

    and in line 333
    Dim DEM As Integer
    Dim Slope As Integer
    Dim s As Single
    Dim Landuse As Integer
    Dim Soil As Integer
    Dim Climate As Long
    Dim IRR As Integer
    Dim Area As Integer
    Dim Country As Long
    'Dim FER As Integer
    Dim MaxIrr As Integer
    Dim ColNo As Integer
    Dim RowNo As Integer

    I also have changed all the dimensions as Double


    I apologize if I did not put the issue right. I am a junior software developer in VBA.
    Attached Files Attached Files

  2. #2
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,138

    Re: vba issue

    I didn't download the attachment. 33.4 KB of code? And that attachment is just part of the code? Good luck getting anyone to go through all of that.

    A variable has a purpose. Blindly changing all variable types as a way of troubleshooting an issue isn't troubleshooting at all.

    You should know what the purpose of each variable is, and therefore what type of data it needs to hold. From there you should be able to declare each variable as the proper type.

    Good luck.

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2019
    Posts
    57

    Re: vba issue

    Dear OptionBase1

    Thank you from the prompt reply. Of course and I know what is the purpose of each variable but I get confused what type it needs to hold. I also have tried with other types such as long but I get most of the results by declaring the variable type as double. Maybe the mistake is somewhere else. I stated from the beginning that I am junior software developer and I apologized.

  4. #4
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,398

    Re: vba issue

    I am still not clear on how your VBA code and the EPIC.exe file are linked. Where is your text file written out? Is it created by your VBA code or by the EPIC.exe program?

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2019
    Posts
    57

    Re: vba issue

    Quote Originally Posted by jdc2000 View Post
    I am still not clear on how your VBA code and the EPIC.exe file are linked. Where is your text file written out? Is it created by your VBA code or by the EPIC.exe program?
    Dear jdc2000 ,

    Thank you for your prompt reply. Epic.exe runs with VBA code data, as a result, EPIC.exe creates the text files.
    Epic.exe checked. I have to declare my variables correct in the VBA code. In that part, I think the problem lies. It is a complicated issue.

Posting Permissions

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



Click Here to Expand Forum to Full Width