BASIC Scripts not working after update...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BASIC Scripts not working after update...

    I have a couple of scripts I have been using iin my programs, then today, we had our software "updated" and now they do not work. Anybody else ran into this? First, a box pops up stating "Action cannot be completed because othe program is busy....", then when I get that closed, An OLE Automation Error pops up saying it cannot create the object. they are all hanging up Line 16 in the sample below - Set App = CreateObject("PCDLRN.Application")

    Code:
    'Option Explicit
    Sub Main 
    
    
    'xl Declarations
    Dim xlApp As Object
    Dim xlWorkbooks As Object
    Dim xlWorkbook As Object
    Dim xlSheet As Object
    Dim count As Integer
    Dim xlWorksheets As String 
    Dim xlWorksheet As String 
    
    'pcdlrn declarations And Open ppg
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Cmds As Object
    Set Cmds = Part.Commands
    Dim Cmd As Object
    Dim DCmd As Object
    Dim DcmdID As Object
    Dim fs As Object 
    Dim DimID As String 
    Dim ReportDim As String
    Dim CheckDim As String 
    
    Dim Cavity As String                                              ‘start worksheet input 1
    Dim myValue As String 
    Dim message, title, defaultValue As String 
    message = "Cavity" 
    title = "cavity" 
    defaultValue = "1" 
    myValue = InputBox(message, title, defaultValue)
    If myValue = "" Then myValue = defaultValue       ‘end worksheet input 1
    
    'Check To see If results file exists
    FilePath = "C:\Excel PC DMIS\3K170 B2A\"
    Set fs = CreateObject("Scripting.FileSystemObject") 
    ResFileExists = fs.fileexists(FilePath & Part.partname & ".xls")
    
    'Open Excel And Base form
    Set xlApp = CreateObject("Excel.Application")
    Set xlWorkbooks = xlapp.Workbooks
    If ResFileExists = False Then
        TempFilename = FilePath & "Loop Template.xls"
    Else
        TempFilename = FilePath & Part.partname & ".xls"
    End If
      
    
    ‘’‘ (Blah, Blah, Blah, more code here……)
    
    
    'Save And Cleanup
    Set xlSheet = Nothing 
    SaveName = FilePath & Part.partname & ".xls"
    If ResFileExists = False Then
    xlWorkBook.SaveAs SaveName
    Else
    xlWorkBook.Save
    End If
    xlWorkbook.Close
    Set xlWorkbook = Nothing 
    xlWorkbooks.Close 
    Set xlWorkbooks = Nothing 
    xlApp.Quit 
    Set xlApp = Nothing
    
    LabelEnd:
    
    End Sub

  • #2
    You had your software "updated" from what to what? What was the old version? What is the new version? Were they both in the same platform, 32 bit vs 64 bit? Did you make any changes to the computer, or replace the computer? Did you update the new software in place of the old? or do they co-exist side-by-side?

    I am not sure all of these are pertinent, but the point is that we do not have enough to go on yet. The more details you can prove, the better our chances of helping.

    Comment


    • #3
      First thing I would try is to copy the script to a text file, then delete the old script, then in a NEW program open the VB scripting editor, paste script from text file, save with same name and location as previous script so no hassle with older programs, and see if that works. Could be new version corrupted the script or something funky in background of file that new software doesn't like.

      Sort of like when something stops working on the computer and all you do is unplug/replug and it starts working again.

      Comment


      • #4
        It went from 2011 MR1 to 2012 MR1

        Comment


        • #5
          Originally posted by jimmyj2000 View Post
          It went from 2011 MR1 to 2012 MR1
          What OS?
          Automettech - Automated Metrology Technology

          Comment


          • #6
            OK, I just experienced the same with 2013 MR1, digged down a bit and found the problem: For some reason the PCDLRN.Application entry in the Registry has not been updated, but still points to an older version of PC-DMIS. Your script will try to start another PC-DMIS, and that will of course not work.

            Here's the cure:

            1. Be careful! You need to edit the Windows Registry - ask someone else for help if you are not comfortable running RegEdit or if anything in these instructions is unclear
            2. You need to be logged in as an Administrator
            3. Start RegEdit.exe, locate HKCR\PCDLRN.Application, open and note the CLSID
            4. Locate HKCR\PCDLRN.Application.7.1, open and note the CLSID
            5. If the CLSID in (3) is not the same as the CLSID in (4), change the CLSID in (3) to be the same as in (4).
            6. Done!

            Note: The .7.1 above is what identifies the PC-DMIS version. If you have something else than 2012 MR1 the number will be different!
            Last edited by AndersI; 02-14-2014, 04:49 AM.
            AndersI
            SW support - Hexagon Metrology Nordic AB

            Comment


            • #7
              It's Windows 7. I'm not seeing an HKCR\PCDLRN.Application in the registry

              Comment


              • #8
                HKCR = HKEY_CLASSES_ROOT - maybe someone else should do it?

                Comment


                • #9
                  Alright, I found it. Just want to make sure before I mess with anything. The PCDLRN.Application.7.1 CLSID does match the PCDLRN.Application CLSID as explained above, but, in between the two is a PCDLRN.Application.6.1, which has a different CLSID. So, I want to change the 6.1 to match the other two?

                  Comment


                  • #10
                    Classic PCDMIS upgrade. Smooth and easy as usual.

                    Comment


                    • #11
                      Got it!! I changed Set App = CreateObject("PCDLRN.Application") to Set App = CreateObject("PCDLRN.Application.6.1") and they are working fine now.

                      Comment


                      • #12
                        Originally posted by frazz View Post
                        Classic PCDMIS upgrade. Smooth and easy as usual.
                        If you ignore the 'schoolboy' error....(For some reason the PCDLRN.Application entry in the Registry has not been updated)...what happened to the Quality Control before it got issued?
                        Poleaxe

                        Beware the environment you live in for it will shape you
                        Be careful the friends you choose for you will become like them.

                        sigpic

                        Comment


                        • #13
                          I had similar issues with BAS scripts. I found out that uninstalling the old version of PCDMIS fixes a problem. Personally I prefer clean install. I takes longer then update but after all works much better.

                          Comment


                          • #14
                            Originally posted by Poleaxe View Post
                            If you ignore the 'schoolboy' error....(For some reason the PCDLRN.Application entry in the Registry has not been updated)...what happened to the Quality Control before it got issued?
                            LOL! You are it, man!
                            PC-DMIS CAD++ 2o19 R1 SP9

                            Comment


                            • #15
                              Originally posted by jimmyj2000 View Post
                              Got it!! I changed Set App = CreateObject("PCDLRN.Application") to Set App = CreateObject("PCDLRN.Application.6.1") and they are working fine now.
                              Note, when you do this, you are explicitly assigning v6.1 as the opened object. The day you uninstall that PC-DMIS version, your scripts that has the explicit binding to PCDLRN.Application.6.1 will probably stop working. So, it is better to fix the rootcause (in the registry) instead of editing all your scripts.
                              PC-DMIS CAD++ 2o19 R1 SP9

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X