Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Problem With VBA in Windows 7

  1. #11
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Hi R.K.,

    Attached is the ".dvb" code file........please let me know if you can identify what is at the root of the problem....?


    Thanks again,
    Vince

  2. #12
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    That file is not the same one from which your screenshots were taken...

    Attachment 76884
    Attachment 76902
    R.K. McSwain | CAD Panacea |

  3. #13
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    R.K.,

    I am sorry about that......I have a number of different routines and I accidently grabbed the wrong one. The correct one is attached below...!



    Regards,
    Vince

  4. #14
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Ok, "SBar" is the name for a Status Bar control (Microsoft Status Bar Active X Control - Version 6) - which on my system is generated from "C:\Windows\SysWOW64\mscomctl.ocx"...

    Not sure if you have this ocx file and/or if it's registered, but it's missing from your first screen shot and present for me (see attached image).

    So, long story short.... the code is trying to change properties of this control, but is unable to do so because it doesn't exist, and there is no error handling for this situation - hence the "crash" (or at least stopping of the code execution...)

    vbaerr.png

    As a workaround, in the VBAIDE, press Ctrl+F to search for "SBar" (make sure to search in 'Current Project')
    In every place you find it, put an apostrophe in front of that entire line of code (commenting out the line).
    Uh, hang on.... inside of the Private Sub cmdBrowse_Click, you will need to comment out the entire IF statement that looks like this:

    Code:
    'If lstAvail.ListCount <> 0 Then
    '        SBar.SimpleText = "...Select .dwg(s) To Plot"
    '    Else: SBar.SimpleText = "...Please Select Directory"
    '    End If

    It should work now - unless of course there are other controls missing/not registered

    Lastly - this was tested on Land Desktop 2009, running on Win7x64
    R.K. McSwain | CAD Panacea |

  5. #15
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Hi R.K.,

    Commenting out the SBar lines of code seemed to make the selection of the drawing files work OK but sometines I had to click the Arrow button that transfers the files from the "Select Drawings Folder" to the "Drawings To Plot" window many times to get it to work. Then I ran into other problems when I tried to Plot.

    If you had no problems running the code in your environment......would it be possible for you to send me a list or screen shot of the modules you have loaded in the References portion of the code. Maybe I can identify what is missing and needs to be loaded.

    Thanks again,
    Vince

  6. #16
    Member
    Join Date
    2015-11
    Posts
    9
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Another gotcha when using Windows 7 is file permission/access.
    The error messages are not always clear that this is the issue.
    Try launching AutoCAD as Administrator. It should be a right-click option on the AutoCAD icon.
    Also, remember that any ocx or dll files that you register must be registered as administrator.

    It may not fix the problem but it would at least rule out the issue.

  7. #17
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Quote Originally Posted by vferrara View Post
    If you had no problems running the code in your environment......would it be possible for you to send me a list or screen shot of the modules you have loaded in the References portion of the code. Maybe I can identify what is missing and needs to be loaded.
    Got just enough time to reply - I can send you a SS later.... but the controls that I'm talking about will not show up in the References - whether present or not.
    R.K. McSwain | CAD Panacea |

  8. #18
    Member
    Join Date
    2011-10
    Posts
    2
    Login to Give a bone
    0

    Default Re: Problem With VBA in Windows 7

    Hi All,
    I have a VBA plugin used in Autocad.This plugin works fine in windows xp and windows 2003 server(64bit) but it fails in Win7(64bit) machine.
    Error is that the pop up window which is MODAL and which should in front is coming in background in case of Win7(64 bit.)
    If somebody have any information about this or any way around, please let me know.
    Cheers
    Rajiv

Page 2 of 2 FirstFirst 12

Similar Threads

  1. 2014: Problem with Browser/Properties windows not docking
    By konetarchitecture in forum Revit Architecture - General
    Replies: 10
    Last Post: 2017-05-25, 09:50 AM
  2. Central file problem windows 7
    By houston.cad in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 9
    Last Post: 2011-02-07, 08:58 PM
  3. Windows XP - Problem Installing to Windows XP Media Center
    By mr.smith2765808 in forum Operating Systems
    Replies: 0
    Last Post: 2011-01-28, 03:39 AM
  4. Is Windows the problem 7?
    By themalachiproject205601 in forum Revit - Platform
    Replies: 1
    Last Post: 2010-07-28, 08:31 AM
  5. Stacked Windows Problem
    By mlgatzke in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-07-15, 01:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •