Page 1 of 1

VBA has become very confused

Posted: Thu Jan 21, 2010 7:23 pm
by ErikS1
I seem to have done something to VBA while working on some updates to one of my VBA routines. I recall the messagebox function exiting with an error along the lines of "object disconnected."

Now routines that used to work no longer work. For example,

Sub GenModel()
Load frmGenerateModel
frmGenerateModel.Show
End Sub

now highlights the "Load" command and fails with an error "Compile Error: Sub or Function not found".

Likewise, any Sub that uses the Load command will fail this way.

I have tried re-booting, as well as going back to a copy of the .VBI file that I saved a few months ago.

Any thoughts other than re-install Intellicad? Am I missing something obvious?

Thanks,
Erik

Posted: Fri Jan 22, 2010 3:33 am
by JCAMPOS
Erik,

Load function should work. I can't think of anything else than re-installing IntelliCAD. Try it to see if it solves your problem.

Regards,
JCAMPOS

Posted: Fri Jan 22, 2010 2:36 pm
by ErikS1
Thanks for the reply.

I got brave and did a remove, reboot, reinstall, reboot sequence.

It did fix part of the problem, but something is still not quite right. I had mixed success. The short routine will run ok, but only if I run Icad as an administrator (Vista 64 bit is such a joy). Previously, I was not running as an administrator

It also seems like Icad is not completely deleting itself. A custom toolbar that I had created is still present after the reinstall. Likewise, there are things in "Common projects" that remain.

Any additional suggestions would be much appreciated. I probably have several hundred hours in on the VBA stuff I am developing, and it was getting close to doing what I need it to do.

-Erik

Posted: Fri Jan 22, 2010 4:35 pm
by ErikS1
I may have found the problem. I discovered a .vbi file in a sub-directory off of

C:\Users\Erik\AppData\Local\VirtualStore\Program Files (x86)\CMS

(for some reason, Vista did not show it to me the first time I searched).

I deleted this entire directory after I removed Intellicad, then did a re-install. So far, it seems to be ok. Now I just need to re-import the various modules, forms and classes and figure out if one of them caused the problem.

-Erik

Posted: Mon Jan 25, 2010 3:42 am
by JCAMPOS
Hi Eirk,

VISTA has a Virtual Store, which is a virtualization of some files and folders to prevent the users to store information in the installation folder. That's why you got another CommonProjects.vbi. The first time that the original CommonProjects.vbi is created/updated, VISTA creates a copy of it in a folder outside the installation folder.

Glad that you found the solution.

Regards,
JCAMPOS