none
The VBA Macro (.dot file) compilation issue on Windows 7

    Question

  • We have developed a word toolbar using VBA Macro. The toolbar is saved in a template. It's running and working fine in Windows XP with both Microsoft Office Word 2003 and Microsoft Office Word 2007.
    When the same Word template containing the macro is installed in Windows 7, it's giving compile error.

    Observation: While openning any word document it shows many compile error messages, but the toolbar get displayed without enabling the functionalities.

        

    I think, some of the components being used by the macros is not present on the machine. Is there a pack that I can install on Windows 7 that'll help me load the VBA macros?

     


    Basavaraj C. Wadi
    Thursday, August 19, 2010 7:46 AM

Answers

  • Hi Basavaraj

    Right, the VB6 calander control would explain it quite nicely. VB6 ActiveX components will no longer work at all under 64-bit. And, since support for VB6 has been discontinued, the VB6 runtime will no longer be distributed with Windows 7.

    If you have VB6, you could probably make a run-time project that would distribute itself and the control - no need for the user to have VB6 actually installed.

    But going forward this is not going to be viable. Office 2007 and 2010 provide a DatePicker content control that can be used on a document, if that's where you have the Calander control. If you have it in a UserForm, then you're going to need something else. I recall seeing something by an Excel MVP, on a website, a while back, that created a "calander" using something like 35 buttons on a form. Perhaps you could leverage that.


    Cindy Meister, VSTO/Word MVP
    Thursday, August 19, 2010 8:37 AM
    Moderator

All replies

  • Hi Basavaraj

    If you OPEN this template (File/Open) in Word installed on Windows 7, then go to the VBA Editor (Alt+F11), you can run Debug/Compile project.

    What line(s) of code are not being correctly recognized? Are you getting any more detailed information about why the compiler doesn't "like" these lines of code?

    Does this happen with both versions of Word installed in Windows 7, or just one (which)?


    Cindy Meister, VSTO/Word MVP
    Thursday, August 19, 2010 7:51 AM
    Moderator
  • Hi Cindy,

    I ran the code in debug mode, it throws an error in the line "Dim cal As Calendar" and the error message shown is "Compile Error: Can't find project or library".

    When I check the references, I see "MISSING: Microsoft Common Dialog Control 6.0".

    I downloaded and tried to install the libraries from the location http://support.microsoft.com/kb/194751 but it needs VB6 to be installed on the system and i dont want to install VB6 on client's machine. So, without VB6 the application shud run.

    Thanks,


    Basavaraj
    Thursday, August 19, 2010 8:27 AM
  • Hi Basavaraj

    Right, the VB6 calander control would explain it quite nicely. VB6 ActiveX components will no longer work at all under 64-bit. And, since support for VB6 has been discontinued, the VB6 runtime will no longer be distributed with Windows 7.

    If you have VB6, you could probably make a run-time project that would distribute itself and the control - no need for the user to have VB6 actually installed.

    But going forward this is not going to be viable. Office 2007 and 2010 provide a DatePicker content control that can be used on a document, if that's where you have the Calander control. If you have it in a UserForm, then you're going to need something else. I recall seeing something by an Excel MVP, on a website, a while back, that created a "calander" using something like 35 buttons on a form. Perhaps you could leverage that.


    Cindy Meister, VSTO/Word MVP
    Thursday, August 19, 2010 8:37 AM
    Moderator
  • It may be possible to add a calendar control that may already be present on the client's machine that you could use instead - see http://www.gmayor.com/popup_calendar.htm

    <Basavaraj C. Wadi> wrote in message news:76860491-72a2-4243-83b4-8d370f2645be@communitybridge.codeplex.com...

    Hi Cindy,

    I ran the code in debug mode, it throws an error in the line "Dim cal As Calendar" and the error message shown is "Compile Error: Can't find project or library".

    When I check the references, I see "MISSING: Microsoft Common Dialog Control 6.0".

    I downloaded and tried to install the libraries from the location http://support.microsoft.com/kb/194751 but it needs VB6 to be installed on the system and i dont want to install VB6 on client's machine. So, without VB6 the application shud run.

    Thanks,


    --------------------------------------------------------------------------------
    Basavaraj


    Graham Mayor - Word MVP
    www.gmayor.com
    Posted via the Communities Bridge
    http://communitybridge.codeplex.com/
    Thursday, August 19, 2010 8:42 AM
  • Graham, Thanks. But I need to instantiate the calendar control at runtime.
    Basavaraj
    Thursday, August 19, 2010 9:49 AM
  • Cindy, Thanks,.This was very valuable information.
    Basavaraj
    Thursday, August 19, 2010 9:50 AM
  • Actually, according to this document: http://msdn.microsoft.com/en-us/vbasic/ms788708 VB6 runtime files are fully supported on Windows 7, and is supposedly distributed in both the 32-bit  and 64-bit versions.

    I haven't checked whether they're there, but am just adding the link for completeness' sake.

    Thursday, January 13, 2011 2:57 AM
  • helpful link, thanks.

    AFAICS one limitation on 64-bit support is stated as "32bit apps running in WOW only"

    and of course you always have to consider what "support for" means in practice, e.g.

    "it just works" ( :-) )

    "quite a lot of it works, and some stuff will be fixed"

    etc.



    Peter Jamieson
    Thursday, January 13, 2011 6:20 PM