none
Build Error: Cannot update WIN32 resources in assembly RRS feed

  • Question

  • I have built a simple Excel 2013 workbook project (not addin) using VS2013 Update 3.

    Whenever I set the workbook property "EnableVBACallers" to true (which also automatically sets property "ReferenceAssemblyFromVBAProject" to true) and build the project I get the error "Cannot update WIN32 resources in assembly "obj\Debug\ExcelWorkbook4.dll". The system cannot find the file specified".

    The assembly exists and I have trusted the file location from within Excel. When the above properties are set to false, the project builds with no errors.

    Any suggestions will be greatly appreciated.

    Wednesday, August 20, 2014 10:18 PM

All replies

  • Hi Scott,

    Did you create a document-level project for Excel 2013 as below?

    According to How to: Expose Code to VBA in a Visual C# Project:

    4. Set the EnableVbaCallers property for the host item to True. This property is available in the Properties window when the host item is open in the designer.

    After you set this property, Visual Studio automatically sets the ReferenceAssemblyFromVbaProject property to True.

    Note                        

    If the workbook or document does not already contain VBA code, or if VBA code in the document is not trusted to run, you will receive an error message when you set the EnableVbaCallers property to True. This is because Visual Studio cannot modify the VBA project in the document in this situation.

    Have you followed the steps in this article? Does this workbook contains VBA code?

    Regards,

    George


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, August 21, 2014 6:18 AM
    Moderator
  • 1. It is a document level project in Visual Basic.

    2. Both EnableVbaCallers and ReferenceAssemblyFromVBAProject are set to true.

    3. Folder and subfolders are trusted in Excel via Trust Center

    4. Macro settings in the workbook are set to "Enable All Macros"

    5.Developer Macro setting "Trust access to the VBA project object model" is checked

    6. Visual Studio added the following code the the VBA project in the module "ThisWorkbook"

    Property Get CallVSTOAssembly() As ExcelWorkbook4.ThisWorkbook
        Set CallVSTOAssembly = GetManagedClass(Me)
    End Property

    7. These lines of code were automatically added to the Thisworkbook.Designer.vb module

     

        Protected Overrides Function GetAutomationObject() As Object

            Return Me

        End Function

    Thanks for the reply

    Thursday, August 21, 2014 4:26 PM
  • Please someone, I need to get this resolved

    Thanks!!

    Thursday, August 28, 2014 6:22 PM
  • Same probelm with Excel 2010 and VS2012 update 4
    Thursday, August 28, 2014 11:12 PM
  • Hi Scott,

    Sorry for the late response, I could reproduce your issue at my side (Office 2013 + Visual Studio 2013 U3 + VB.NET). I’m still troubleshooting this issue and I’ll also ask some senior engineers to look into it. It will take some time, your patience will be highly appreciated.

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, September 2, 2014 6:24 AM
    Moderator
  • Thanks Jeffrey...much appreciated!
    Thursday, September 4, 2014 12:27 AM
  • Jeffrey, any progress on this issue?

    Thanks, Scott

    Tuesday, September 9, 2014 4:45 PM
  • Hi,

    We tried to repro the issue at a machine where VS 2013 RTM was installed  with the steps below
      1. Create an *.xlsm document level VSTO customization keeping vb.net as language
      2. Go to Project properties and set "EnableVBACallers" to true

    Actual : Upon build we get error "Cannot update WIN32 resources in assembly"
    Expected : VSTO customization should build with out error

    However I could not repro the issue in VS 2013 Update 3.

    Please let me know if I am missing any necessary steps here. I am using Excel 2013 32-bit (15.0.4641.1000 MSO 15.0.4641.1002).

    At this point I would recommend that you are at the latest patch level for Office and try if you are able to reproduce the issue. You might also want to try reinstalling VSTO runtime from the following location:

    Visual Studio 2010 Tools for Office Runtime

    http://go.microsoft.com/fwlink/?LinkId=140384


    Sangeeth,MSFT



    Tuesday, September 9, 2014 10:09 PM
  • I updated Excel 2013 (office Pro Plus 2013) to (15.0.4649.1000 MSO 15.0.4649.1000). VS is VS Premium 2013 Version 12.0.30723.00 Update 3 running as administrator.

    I updated Visual Studio 2010 tools for Office runtime.

    Created a new proect using steps 1 and 2 above. I still get the same error.

    • Edited by Scott111 Wednesday, September 10, 2014 1:20 AM
    Wednesday, September 10, 2014 1:19 AM
  • I desperately need to resolve this issue. Any other ideas?

    Also, I am running Windows 7 Ultimate Service Pack 1...wonder if the operating system has anything to do with this problem.

    • Edited by Scott111 Wednesday, September 17, 2014 8:24 PM
    Tuesday, September 16, 2014 4:08 PM
  • Hi Scot,

    I tried to reproduce the issue at another machine and I could reproduce the issue with a Windows 8.1 + Office 2013 32 bit C2R installation.

    We might need to do advanced troubleshooting on this issue to find out how to avoid this issue. Because of its complexity your question falls into the paid support category which requires a more in-depth level of support.  If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Thanks

    Sangeeth


    Sangeeth,MSFT

    Thursday, September 18, 2014 5:56 PM
  • Sangeeth, thanks for the reply. You stated that you WERE able to reproduce the error on windows 8.1 + Office 2013 32-bit C2R.

    Jeffrey Chen was also able to reproduce the error with Office 2013 + Visual Studio 2013 U3 + VB.NET (see post above)

    Why would this fall into a paid support category?

    Thanks,

    Scott


    Thursday, September 18, 2014 6:06 PM
  • Sangeeth, please send me a project/solution that you have found to work and I will try it on all of my development machines. email to scolli19@gmail.com

    Thanks

    Saturday, September 20, 2014 2:31 PM
  • Mahesh/Scott,

    Any updates regarding resolution of this issue? We have encountered this exact situation.

    We recently purchased multiple copies of VS2013 to upgrade our development team from VS2010. We have a number of applications that rely on VBA calls from the host Excel document into the VSTO assembly. This of course is not possible with the errors described and as a result our purchase of VS2013 is of no use until the issue is corrected.

    We have tried every VS 2013 Update (Updates 1-3 and even Update 4 RC) with no luck.

    Mahesh, could you please provide more details regarding your proposed workaround? For some reason we can’t get it to work. Also, would this workaround procedure allow us to publish the solution without error via click-once installation?

    Thanks so much for your assistance.

    Kyle.

    Thursday, October 23, 2014 9:49 PM
  • Hi Kyle, Scott,

    Sorry to hear that, but we have already logged this bug against VS2013. Ignore the previously posted workaround(deleted to avoid confusion) and try this one.

    At this stage, we can suggest only workaround till we get the actual fix. This seems to have worked.

    1. Set ReferenceAssemblyFromVbaProject’ to false
    2. F5 the VSTO project,
    3. Open VBA IDE
    4. Add reference to {ProjectRoot}\obj\debug\xxx.tlb manually.
    5. Add reference to “C:\Program Files (x86)\Common Files\Microsoft Shared\VSTO\vstoee90.tlb” for 32-bit Office or "C:\Program Files\Common Files\microsoft shared\VSTO\vstoee90.tlb" for 64-bit Office.

    Unfortunately, you have to do this for every F5.

    Let me know if this works for you.

    Note: Users can use Dev 14 CTP for this, which does not have this problem.



    Friday, October 24, 2014 12:56 PM
  • Mahesh,

    Thank you so much for your response. Yes, I can get the workaround to apply to “most” of our VS projects. There are a few additional things that I would note that may help others.

    First, the xxx.tlb file will not be created unless you first attempt to build/execute the project with the ‘ReferenceAssemblyFromVbaProject’ property set to true. This will of course result in the subject error and won’t allow further execution but the required file will still be generated prior to this point.  I would also assume that if changes are made to the VBA code that this file may need to be regenerated.

    Second, if you then go directly to the source file of the document (e.g.  xxx.xlsm) for the project and change the references in the VBA IDE and save this file, then the references remain available when the project is executed.

    Lastly, just a couple more questions if I could:

    1. As I understand it, the workaround only applies while debugging the project. Is there any way to then publish the application (particularly with ClickOnce) that will still include the functionality provided by the ‘ReferenceAssemblyFromVbaProject’ flag.
    2. Can you provide any indication as to when this bug may be addressed by the VS team? Could it possibly be included in final Update 4? Is the problem a high or low priority on the VS2013 Log? Seems like it should be fairly significant given that it in effect cripples a large feature of VSTO.

    Thanks again Mahesh!!!  


    • Edited by kbozzjm Monday, October 27, 2014 9:44 PM
    Monday, October 27, 2014 9:39 PM
  • Hi kbozzjm, 

    Thanks for sharing the additional note for this issue. 

    Regarding your question 1, I do not have answer for this, so leaving it for others to reply if they are aware of this. 

    For the question2, we have raised this defect as important one but not sure about the dates or build number to look for. 

    Wednesday, October 29, 2014 12:36 AM
  • This really needs fixed

    I have exactly the same problem with the same error "Cannot update WIN32 resources in assembly "XXX.dll". The system cannot find the file specified". The workaround above does not work for me.

    I cannot get my VSTO excel solution to compile at all and work with EnableVBACallers and ReferenceAssemblyFromVbaProject set in either VS 2013 Community or VS 2012 Ultimate.

    I can however get the solution to work with VS 2010 which works perfectly.

    Just a pity I have to go back to the VS 2010 software due to a lack of attention fixing this problem for VSTO solutions. Please fix

    Thursday, November 27, 2014 8:36 PM
  • Any fix for this yet?
    Thursday, April 9, 2015 3:39 PM
  • Has anyone found a solution to this?? 
    Monday, January 23, 2017 8:02 PM