Showing posts with label Office. Show all posts
Showing posts with label Office. Show all posts

2014-11-14

Could not load file or assembly Microsoft.Office.BusinessApplications.Fba VSTO error

Here is an error that plagued me (occasionally) for months.  Since Office 2013 was rolled out, we would sometimes get a call from a user trying to install an older Visual Studio Tools for Office add-in. Not sure how much of the specifics are at play here, but these were the facts in this situation:

Windows version: Windows 7
New Office version: Office 2013
VSTO Add-In version: Office 2007
VSTO Add-In application: Excel

The full text of the error was:

The value of the property 'type' cannot be parsed.  The error is: Could not load file or assembly 'Microsoft.Office.BusinessApplications.Fba, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9r29c' or one of its dependencies. The system cannot find the file specified. (C:\Program Files (x86)\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe.Config line 10)

clip_image002

For months, all I could find was this post suggesting to repair Office.  Unfortunately, it failed to correct the issue and we were forced to uninstall and reinstall Office 2013 on a number of machines.  After a successful reinstall of Office, the VSTO installation ran to completion. This is a pain for both the support personnel and the users.

Today I found and successfully used the post at the end of this thread.  My experience wasn’t quite as clean as described, but it worked.  Here’s what I did:

  1. I right-clicked on setup.exe (installer for VSTO application) and chose ‘Run as administrator’. Answered [Yes] at the UAC prompt.
  2. I received a message informing that I already had the VSTO application installed.  The application was not showing in Excel, however this was already a step further than previous installation attempts.
  3. I pushed forward, found the VSTO application in Programs and Features and uninstalled it.
  4. Finally, I ran setup.exe again - this time not using ‘Run as administrator’.  It installed successfully and runs as expected. (Plan was to use Run as admin again if it failed, but it wasn’t required.)

Hope this helps others, too.

Later.

2011-02-24

A Plea for Custom Document Property Manipulation in Excel

In my experience, the capabilities of Microsoft Excel have far outweighed that of Microsoft Word.  It may possibly be my line of work, but I’ve thus far always found that I can accomplish more with Excel’s formulas, references, and especially macros than I could ever hope to get out of a Word document.  Word was great for typing fancy-looking text, but when I required any amount of functionality Excel was always there to save.  Until today…


The Request
Microsoft: please enhance Excel such that I can
  1. Retrieve and manipulate Custom Document Properties using only Formulas (no macros required) in the same way that can be found using Word’s Insert > QuickParts > Field functionality.
  2. Insert these same custom document properties into the header/footer section of a worksheet.

Microsoft Word
For example, in Word, I can choose Insert > Quick Parts > Field > DocProperty.  Then choose any document property maintained and insert a reference to it.
prop01


Limitation of Microsoft Excel
Unfortunately, in Excel a macro must be written in order to retrieve values from the CustomDocumentProperties collection.  A formula can then reference this macro.  In a corporate network with any sort of security policy, this means that users must “enable the macros” for this to function properly.

Function GetProperty(PropertyName As String, PropertySet As PropertyLocation, _
    Optional WhatWorkbook As Workbook) As Variant
(Reference Chip Pearson’s website for GetProperty code.)

Further, I’m unable to insert any auto-updated values into the footer of an Excel worksheet other than the handful of values pre-defined by Microsoft: page number, date/time, sheet name, etc.  In order for this to occur, I need yet another macro to execute Before_Print.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
    With Worksheets("Sheet1").PageSetup
        .CenterFooter = GetProperty(“Issue.Header.Id”, 2)
    End With
End Sub
Code found by doing a Google search for excel formula in footer.

I’d like to see efforts made to improve the functionality of these items in the next release of Microsoft Excel.

Enjoy!

2010-06-25

InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file

I've been working on a problem for the past half a day with the MS Office 2007 PIA.  The issue is with MS Office automation on Windows Server 2008 (x64).

This statement fails:

                wb = (Excel._Workbook)(books.Open(_sourceFilename, 0, true, missing, missing,
                                                 missing, true, missing, missing, missing, missing,
                                                 missing, missing, missing, missing));
with error:
System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file ''. There are several possible reasons:

• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
   at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)
The solution is an odd one: create the directory "C:\Windows\SysWOW64\config\systemprofile\Desktop".

That's it.  Works like a charm.