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

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
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 »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
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).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
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).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 08, VBA, and Vista
« Reply #10 on: November 10, 2007, 04:55:53 PM »
<fingers crossed>
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

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).


David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4065
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)