• Macros not running (Excel 2000)

    • This topic has 8 replies, 3 voices, and was last updated 22 years ago.
    Author
    Topic
    #385954

    I received a spreadsheet from someone and the macros do not run. I am not prompted to enable or disable macros when I open the file. Perhaps this is a function I do not have enabled?

    Can anyone see the problem with this spreadsheet?

    Thanks…Susan

    Viewing 0 reply threads
    Author
    Replies
    • #667756

      You probably have your security settings set to high.

      Go to Tools, Macros, Security and if set to High change to Medium.

      Andrew C

      • #667759

        That worked perfect. Thank you very much.

      • #669298

        I am still having problems with this file on Windows 2000 stations. The security is set to medium, references are set correctly and I still get a “compile error, cannot find project or library”. I uninstalled and reinstalled office with all the options. In the references was a “MISSING: Microsoft Windows Common Control2-6” so installed windows 2000 sp3. This still did not resolve the problem.

        Does anyone have any ideas?

        • #669308

          Microsoft Windows Common Controls-2 6.0 are not part of a standard Office or Windows installation, as far as I know. These controls come with Visual Studio 6 (VB6 etc.), and with Office Developer Edition. So you’re bound to run into trouble on some PC’s, unless you make an installation package that installs these controls (in this case, the file is MSCOMT2.OCX).

          • #669318

            I did try to copy this file to the system32 directory, and I still get the compile error. However, when I save this file on a windows 98 machine, it opens fine on a windows 2000 pc.

            I will try to find the visual studio 6 software and install it on the windows 2000 station. Thanks.

            • #669321

              You can’t just copy such a file to another machine; it has to be registered too. That’s what installation programs do for you. There may be tricks to do it, but I can’t help you with that…

            • #669335

              You need to register the control on th etarget system. Windows has a utility called Regsvr32 to do just that.

              Run the following command :

              Regsvr32 /s C:WindowsSystem32MSCOMCT2.OCX

              I attach a workbook that will on opening install the control for you provided that a copy of Mscomct2.ocx is included in the same folder as the workbook. It copies the control to the system directory and then registers the control on the target computer..

              The code is as follows :

              Private Declare Function GetSystemDirectory Lib “kernel32” _
              Alias “GetSystemDirectoryA” ( _
              ByVal lpBuffer As String, _
              ByVal nSize As Long) As Long

              Function SysDir()
              Dim sSave As String, Ret As Long
              sSave = Space(255)
              Ret = GetSystemDirectory(sSave, 255)
              sSave = Left$(sSave, Ret)
              SysDir = sSave
              End Function

              Private Sub Workbook_Open()
              Dim wshShell, oFSO, sf
              Dim strInstallFrom As String
              strInstallFrom = ThisWorkbook.Path & “”
              Set wshShell = CreateObject(“WScript.Shell”)
              Set oFSO = CreateObject(“Scripting.FileSystemObject”)
              On Error Resume Next
              oFSO.CopyFile strInstallFrom & “Mscomct2*”, SysDir
              On Error GoTo 0
              Shell “Regsvr32 /s ” & SysDir & “Mscomct2.ocx”
              Set sf = Nothing
              Set wshShell = Nothing
              Set oFSO = Nothing
              MsgBox “Mscomct2.ocx installed”, vbInformation
              End Sub

              Andrew C

            • #669367

              This worked perfect. Thank you very much.

    Viewing 0 reply threads
    Reply To: Reply #667759 in Macros not running (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel