TheSwamp
Code Red => VB(A) => Topic started by: David Hall on November 10, 2007, 03:36:44 PM
-
Has anyone gotten VBA and 08 to play nicely on Vista? I brought some of my code from work home, and kept getting catastrophic failures. (Thats what the msgbox says, yet Autocad doesn't crash.) I'm beginning to think Vista is a really bad thing for Autocad at this point
-
Try running AutoCAD as an administrator. Right click shortcut "Run as administrator".
Trying to run Visual BASIC 6 otherwise was a gong show, especially when trying to compile dlls (kept getting a friendly and illuminating 0x80004005 error).
You can set shortcuts to always run as said state (on shortcurt by shortcut basis), which makes it a little easier.
-
I did the rigft click thing, and that didn't help.
-
and the sub is very basic
Public Sub VPLock()
On Error GoTo Err_Control
Dim vp As AcadPViewport
Dim gpCode(0) As Integer
Dim dataValue(0) As Variant
Dim objSelSet As AcadSelectionSet
gpCode(0) = 0
dataValue(0) = "VIEWPORT"
Set objSelSet = ThisDrawing.SelectionSets.Add("VPL")
objSelSet.Select acSelectionSetAll, , , gpCode, dataValue
For Each vp In objSelSet
If vp.DisplayLocked = True Then
vp.DisplayLocked = False
End If
Next
Exit_Here:
Exit Sub
Err_Control:
Select Case Err.Number
Case "-2145320851"
ThisDrawing.SelectionSets.Item("VPL").Delete
Err.Clear
Resume
Case Else
MsgBox Err.Number & Err.Description
Err.Clear
Resume Exit_Here
End Select
End Sub
-
YEOW!
Sorry, without a clue (more than normally that is).
-
Funny thing is, in the local window, 80% of the entries say "No Database" like VBA suddenly lost the connection to the dwg. Even if Im in the Thisdrawing module.
-
I ran your code on machine Cmdr and no errors (Vista Ultimate + AutoCAD '08).
??
(And it did unlock locked viewports).
-
I have Vista Home Premium i think
edit : Confirmed
-
You can set shortcuts to always run as said state (on shortcurt by shortcut basis), which makes it a little easier.
MP, How? I haven't seen this anywhere, but I will admit I haven't looked to hard. I hate Vista, but I know I will have to learn it soon enough
-
Just found it. we will see if that fixes my code
-
<fingers crossed>
-
did'nt fix it
-
IT at work is testing Vista Ultimate 64 wit Civil 3D 2008 (crammed FULL of VBA) and is not having any similar issues.
-
Has anyone gotten VBA and 08 to play nicely on Vista? I brought some of my code from work home, and kept getting catastrophic failures. (Thats what the msgbox says, yet Autocad doesn't crash.) I'm beginning to think Vista is a really bad thing for Autocad at this point
Vista/Cad 64Bit or 32Bit?
I have had issues with Vista 64bit and 2008 (64bit), but none with Vista 32 Bit and 2008(32bit).
-
32 both items. I wonder if its b/c of the Home Edition?
-
Well, my prop box quit working, so I did a fresh install of autocad, and it appears to be working now. Looks like I got acad corrupted somehow.
-
Funny thing is, in the local window, 80% of the entries say "No Database" like VBA suddenly lost the connection to the dwg. Even if Im in the Thisdrawing module.
a bit late now that you have got it fixed, but.... I have come across that "No Database" error message a few times now and the only way to resolve it is to do another install
-
Not familiar with that problem but - overall, if you can - get away from vb6 / vba and run as fast as you can.
It's going to become more and more unattractive to code using those tools in the future.
-
Hendie, thanks, I wish I had known that sooner.
Draftek, I'm still trying to get more than just my foot wet converting to C#. Seems like every time I get some time to start again, something breaks major-ally at work
-
I know what you mean,
I've got a project I'm dying to work on but the time required supporting all the old crap I wrote won't allow me to write new crap.. :)