Upgrade Win2k to WinXP, my VBA is dead

Discussion in 'AutoCAD' started by Paul Houlker, Feb 17, 2005.

  1. Paul Houlker

    Paul Houlker Guest

    We just got the first of four new computers (the other three going in today)
    I loaded up our MDT6 & the custom VBA we have been running for a couple of
    years and nothing works.
    I cant even view the forms I get an "Unspecified Error".

    I dont even know where to start here, has anyone gone through the Win2k to
    WinXP upgrade that can give me a hint where to start???
     
    Paul Houlker, Feb 17, 2005
    #1
  2. Don't try to RUN the program, instead STEP INTO it so you can find the lines
    where the error is actually happening.

    1) VBAMAN at ACAD prompt
    2) Load the DVB file
    3) Select the DVB file and press MACROS button
    4) Select the startup subroutine and press STEP INTO button
    5) Hit F8 key to step one line. Repeat until error occurs.
    6) Repeat steps 4 and 5 until debugged. Post the problematic section of
    code to the NG.

    James
     
    James Belshan, Feb 17, 2005
    #2
  3. Paul Houlker

    fantum Guest

    If Office was involved in the upgrade then you will probably have to re-install autocad. If Office still does that "install-on-first-use" thing then you'll want to make sure "first use" happens first.
     
    fantum, Feb 17, 2005
    #3
  4. Paul Houlker

    Murph Guest

    An other thing to try is give the user full admin rights run the routines
    then drop the users' right back down to their normal rights.

    Murph


    re-install autocad. If Office still does that "install-on-first-use" thing
    then you'll want to make sure "first use" happens first.
     
    Murph, Feb 17, 2005
    #4
  5. Paul Houlker

    Paul Houlker Guest

    Thanks all for the info.

    Update :
    I managed to get half of it working, and isolate the bad half.
    The half I got working is the stuff critical to day to day operations, so my
    panic is over.
    The bad half has a ton of windows API calls dealing with file manipulation
    and files properties. I suspect differences between the Win2k and WinXP API
    to be the issue. I will dig into this as I get time.
    The strange part, one forum in the project, uses only standard controls, and
    functions as a simple calculator, numbers enter in textboxes, splits out the
    answer, simple. But on the WinXP machine it refuses to even let me see the
    code or form in the VBA editor. I tried stepping in and it bails with a
    compile error before the first line. Its so simple I can recode from
    scratch in an afternoon, but still its strange that such a simple thing does
    not work.

    Again, thanks for the advice.
     
    Paul Houlker, Feb 17, 2005
    #5
  6. First, if you still have any of the old machines around, load up your
    project, and cut/paste the code into a text file that you can paste into the
    a new fom on the WinXP version.

    But if you don't have any Win2k machines left, this is a shot in the dark,
    but maybe you'd be able to export the code with the following backup routine
    that a kind person posted in the NG. Maybe it will be able to get to the
    form's code without activating the form. just a hopeful guess....

    James



    '-----------------------------------------------------------------------
    ' export all components for this project to a folder with the current
    date/time
    '-----------------------------------------------------------------------

    Sub VSS_Component_Backup()

    Dim VBProj As Object
    Set VBProj = Application.VBE.ActiveVBProject
    Dim vbComps As Object
    Set vbComps = VBProj.vbComponents
    Dim vbComp As Object
    Dim FileName As String
    Dim dirpath As String
    Dim fileExt As String

    Dim FS As Object
    Set FS = CreateObject("Scripting.FileSystemObject")

    dirpath = "c:\temp" & VBProj.Name & "_backup_" & _
    Format(Date, "mmddyy") & "_" & Format(Time, "hh-mm") & "\"

    ' create the folder
    On Error Resume Next
    Call FS.CreateFolder(dirpath)

    If Err.Number <> 0 Then
    ' clear the error
    On Error GoTo 0
    ' the folder couldn't be created
    MsgBox "Warning: Can't create the folder for the dvb components."
    Else
    ' clear the error
    On Error GoTo 0
    'process the components
    For Each vbComp In vbComps

    If vbComp.Type <> 100 Then ' skip the autocad object

    If vbComp.Type = 3 Then
    fileExt = ".frm"
    End If
    If vbComp.Type = 1 Then
    fileExt = ".bas"
    End If
    If vbComp.Type = 2 Then
    fileExt = ".cls"
    End If
    FileName = dirpath & vbComp.Name & fileExt
    vbComp.Export FileName
    End If
    Next
    End If
    End Sub
     
    James Belshan, Feb 17, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.