Author Topic: 08, VBA, and Vista  (Read 3179 times)

0 Members and 1 Guest are viewing this topic.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
08, VBA, and Vista
« 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
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

MP

  • Seagull
  • Posts: 17488
Re: 08, VBA, and Vista
« Reply #1 on: November 10, 2007, 03:40:07 PM »
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.
« Last Edit: November 10, 2007, 03:48:01 PM by MP »
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #2 on: November 10, 2007, 03:46:19 PM »
I did the rigft click thing, and that didn't help.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #3 on: November 10, 2007, 03:46:55 PM »
and the sub is very basic
Code: [Select]
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
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

MP

  • Seagull
  • Posts: 17488
Re: 08, VBA, and Vista
« Reply #4 on: November 10, 2007, 03:49:21 PM »
YEOW!

Sorry, without a clue (more than normally that is).
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #5 on: November 10, 2007, 03:51:27 PM »
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.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

MP

  • Seagull
  • Posts: 17488
Re: 08, VBA, and Vista
« Reply #6 on: November 10, 2007, 03:58:45 PM »
I ran your code on machine Cmdr and no errors (Vista Ultimate + AutoCAD '08).

??

(And it did unlock locked viewports).
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #7 on: November 10, 2007, 04:30:33 PM »
I have Vista Home Premium i think
edit : Confirmed
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #8 on: November 10, 2007, 04:51:39 PM »
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
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #9 on: November 10, 2007, 04:54:57 PM »
Just found it. we will see if that fixes my code
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

MP

  • Seagull
  • Posts: 17488
Re: 08, VBA, and Vista
« Reply #10 on: November 10, 2007, 04:55:53 PM »
<fingers crossed>
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #11 on: November 10, 2007, 05:09:10 PM »
did'nt fix it
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Diněsaur

  • Certified Bovine Scat Distributor...I lay it on THICK
  • Needs a day job
  • Posts: 5424
  • But I don't WANT a Day Job
Re: 08, VBA, and Vista
« Reply #12 on: November 10, 2007, 07:23:00 PM »
IT at work is testing Vista Ultimate 64 wit Civil 3D 2008 (crammed FULL of VBA) and is not having any similar issues.
Stephen R. Sherrill,
The Diněsaur
Civil 3D Specialist Emeritus

YAY ME !!!  I made it out alive !

joseguia

  • Guest
Re: 08, VBA, and Vista
« Reply #13 on: November 11, 2007, 02:11:40 AM »
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).


CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #14 on: November 11, 2007, 10:01:59 AM »
32 both items.  I wonder if its b/c of the Home Edition?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #15 on: November 11, 2007, 06:48:35 PM »
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.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

hendie

  • Guest
Re: 08, VBA, and Vista
« Reply #16 on: November 12, 2007, 03:39:29 AM »
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

Draftek

  • Water Moccasin
  • Posts: 1501
Re: 08, VBA, and Vista
« Reply #17 on: November 12, 2007, 08:12:49 AM »
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.
Soli Deo Gloria

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: 08, VBA, and Vista
« Reply #18 on: November 12, 2007, 09:33:39 AM »
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
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

Draftek

  • Water Moccasin
  • Posts: 1501
Re: 08, VBA, and Vista
« Reply #19 on: November 12, 2007, 09:56:53 AM »
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.. :)
Soli Deo Gloria