VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Program wont work

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
249 Views, 7 Replies

Program wont work

Hey all

My head is starting to hurt now. I have a program that works perfectly fine on my pc, however, when I send it to our CAD Manager to talk him through it, errors appear that do not appear on mine, and we are doing exactly them same thing. I compiled the code before sending it to him.

Can anyone shed some light on this one for me?

Thanks
Brent
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

wrote in message news:5859291@discussion.autodesk.com...
Hey all

My head is starting to hurt now. I have a program that works perfectly fine
on my pc, however, when I send it to our CAD Manager to talk him through it,
errors appear that do not appear on mine, and we are doing exactly them same
thing. I compiled the code before sending it to him.

Can anyone shed some light on this one for me?

Thanks
Brent

sure, somethings wrong.
:-)

...seriously though, you really think someone can tell what's happening from
that detailed description?
for starters, what errors, what lines are errors occuring on (copy paste
code)
are there references missing on the cad managers machine?
do you have error logging in the app so you can follow the program flow and
see where it bombs?

hth
mark
Message 3 of 8
Anonymous
in reply to: Anonymous

Hi Mark,

I am not an advanced programmer by any stretch of the imagination, in fact I am essentially self taught, so I must apolgise if some of my posts seem vague and ambiguous.

Question:
How do you create error logs.

Errors
Initially there is a run time error 1004. If I can tackle that one first and get an error log happening, I might be able to figure it out.

Thanks
Brent

I checked the references - nothing missing
Message 4 of 8
arcticad
in reply to: Anonymous

Maybe something similar to this

You may receive a "Run-time error 1004" error message when you programmatically set a large array string to a range in Excel 2003
View products that this article applies to.

In Office Excel 2003, when you programmatically set a range value with an array containing a large string, you may receive an error message similar to the following:
Run-time error '1004'.

http://support.microsoft.com/kb/818808

Sorry, I don't have my magic Hat. You really need to sit down on his machine and walk through the program and see where it's failing.
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 5 of 8
Anonymous
in reply to: Anonymous

wrote in message news:5859307@discussion.autodesk.com...
Hi Mark,

I am not an advanced programmer by any stretch of the imagination,

- neither am I 😉

in fact I am essentially self taught,

- so am I 🙂


so I must apolgise if some of my posts seem vague and ambiguous.

- no apology req'd, just more information on what the problem at hand
is...especially showing the actual code and the actual line on which error
occurs


Question:
How do you create error logs.

two simple options
1) at the simplest put Debug.Print statements liberally where things may go
wrong so you can see in the immediate window where you're at.

2) more useful - especially for long routines is to write to textfile ...
again, at whatever "milestones" make sense in the context of your app.
for example assuming there is a global variable msLogFileName
Public Sub LogWrite(sMsg As String)
Dim iFileNum As Long

If Len(msLogFileName) > 0 Then
iFileNum = FreeFile
Open msLogFileName For Append As #iFileNum

Print #iFileNum, sMsg
Close #iFileNum

End If
Debug.Print sMsg & " "
End Sub


Errors
Initially there is a run time error 1004

- now we're getting somewhere...
post the code in the vicinity of that error and the line it occurs on

since its' "Application-defined or object-defined error" you must be trying
to use some object is throwing the error?
are you hitting another app like excel or ???




. If I can tackle that one first and get an error log happening, I might be
able to figure it out.

Thanks
Brent

I checked the references - nothing missing
Message 6 of 8
rocheey
in reply to: Anonymous

This, by the way, is why I still LOVE coding in VBA - because its interpreted. Sure, I'll still write compiled VB6/.net stuff, but there is still a romance with raw, interpreted code....
Message 7 of 8
Anonymous
in reply to: Anonymous

Error number very often helps little, if not at all. I have been programming
many years and remember very few error number's meanning.

If your program is Acad VBA, you can simply do quick debugging in any
computer (that is, in your CAD manager's computer when the show-off run runs
into error) by going to VBA IDE, menu "Tools->Options...", selecting
"General" tab and checking "Break at all error" radio button. Then run the
program again. Now if the program runs into the same error, a message box
will ask you to "continue" or "debug", click "Debug" will brings you to the
offending line of code, so that you can tell/analyse what is causing the
problem.

Another debuging tip is to do the compiling in the problem machine to find
out "Missing reference..." issue. You did not say what your program does in
detail (this will help someone help you a lot, if you did), but if your
program uses some resources that may not present in the other computers (or
the same type of resources but in different version), you will very likely
run into error.

When having question like this, always tell more details on your program,
such as description of the process, which version of Acad, OS, other related
software/resources...

"BrentB" wrote in message news:5859307@discussion.autodesk.com...
Hi Mark,

I am not an advanced programmer by any stretch of the imagination, in fact I
am essentially self taught, so I must apolgise if some of my posts seem
vague and ambiguous.

Question:
How do you create error logs.

Errors
Initially there is a run time error 1004. If I can tackle that one first and
get an error log happening, I might be able to figure it out.

Thanks
Brent

I checked the references - nothing missing
Message 8 of 8
arcticad
in reply to: Anonymous

My favorite erorr is "Undocumented Error #5" , Well. if it's undocumented .....
---------------------------



(defun botsbuildbots() (botsbuildbots))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost