Office 2011 VBA issue

  • Hey guys. Thanks in advance for any help that anyone might have!


    Background of Project
    I am developing a "program" if you will, basically a compilation of VBA macros that will allow the user to enter guest info for their wedding, then take the information and display it in a more user friendly view, give different reports on different aspects such as if invitations have been sent to who, and number of people coming.


    Problem
    I am trying to implement a mail merge type system to this so people that are less experienced with mail merge would only have to select what paper type they are using, and all the fields will auto populate and be ready for them to print. When working on this on my Windows box, using office 2010, I can use the following line to bring up the Label Options window:


    Code
    mmDoc.mailMerge.Application.Dialogs(wdDialogLabelOptions).Show 'shows dialog to choose paper type

    On my Mac box, using office 2011 I get the following error:
    Compile error:
    Can't find project or library


    When looking under Tools >> References I see that it says I am missing Microsoft Office 14 Authorization Control 1.0 Type Library. Thinking that was the issue I tried to find and download that, but all I can find is a .dll file, which I believe to be only windows compatible, and couldn't get to work.


    The following are the checked references:
    Visual Basic for AApplications
    Microsoft Excel 14.0 Object Library
    Microsoft Word 14.0 Object Library
    OLE Automation
    Microsoft Office 14.0 Object Library


    The following are the other available references (not checked):
    Chart 14 Type Library
    Microsoft Graphy 14.0 Object Library
    Microsoft PowerPoint 14.0 Library
    Microsoft Visual Basic for Applications Extensibility 5.3


    I have tried checking all the references and still get the same error on the same line. I am no expert, but it seems like I need a Library reference? I can't seem to find any answers in my searching, so I turn to you to see if anyone knows and wishes to bestow their wisdom to me :D

  • Re: Office 2011 VBA issue


    Did you try simply removing that missing reference link? The MailMerge feature or the dialogs feature has nothing to do with the authorization control, so your code should work regardless of it being checked. What you need to find out though, is what stops any macro in your file from running in 2010 if you remove the reference to that library. If everything works fine then in 2010, it should work fine in 2011 as well.

  • Re: Office 2011 VBA issue


    I unchecked the missing reference and now I get a Run time Error on the same line that I was erroring out before. Below is the error and the code.


    Run-Time Error '5941':
    The reuqested member of the collection does not exist


    Looking into the object library of word on my Mac, I do not see the wdDialogLabelOptions command. I looked up the number code on my windows box and put that code in (1367) and got an error saying "This Method or property is not available because the command is not in Word for the Macintosh. Any ideas as to how I could bring up the dialog prompt titles Label Options to allow the user to pick their Label type?


    Thanks

  • Re: Office 2011 VBA issue


    As expected at .OpenDataSource would fail because you do not have to file I am using for the merge. I can not get so that point on my Mac system. I am looking for a command that might bring up the same menu, but not having much luck. I might forgo the entire automation of mail merge, and simply pull up a Word Document with instructions on how to perform the mail merge on both systems, or include a PDF with instructions when I give the sheet out. That would help fix lots of other frustrating things that might happen from having different file names and locations as well.


    Thank you for your help, and I will post here again if I find a way to do this along my original plan, but most likely will not do that because of so many variables.

  • Re: Office 2011 VBA issue


    Sorry for not being 100% clear. I have a problem on that line ONLY on my Mac excel 2011. wdDialogLabelOptions evidently is not a valid dialog box to show on the Mac version of office.

  • Re: Office 2011 VBA issue


    Yes. In Office 2011 I click Tools >> Labels >> Options and the Label Options dialog box shows up, giving the same options as the Label Options dialog in Office 2010.

  • Re: Office 2011 VBA issue


    I can manually display the dialog, but recording a macro will only end up giving the code to creating a new document based on the label chose, and does not inform me as to how to bring up that particular menu.

  • Re: Office 2011 VBA issue


    When I have more time to work on this later this weekend I will look into it more and see if there is simply a different name to bring up the menu or something like that. I will post here again if I find something. Thanks for your help!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!