Excel Macro Compatibility Issue - vba

I have added my macro to a already existing excel file with macros (build on lower version of excel). It is working fine on my system as well as other systems with same excel version. But when the excel file is opened in other versions, it either crashes or gives error messages like unexpected error occurred(32809)/ compile error. I am using Excel 2010 14.0.7143.500. Can any body tell me how to resolve this issue?

The Telemetry Log displays some simple information about the recorded events. Each record displayed in the Telemetry Log contains a title and lists the severity of the event displayed. For errors, the records also include a description of the error together with steps to address the issue. Keep in mind that not all of the records displayed represent errors caused by Office solutions; the Telemetry Log also shows when solutions and files are loaded or closed successfully.
For example, the issue titled "OM Hidden: Comment.Initial Property" appears if a solution or macro-enabled file opened in Word 2013 attempts to get the initials of a commenter who is associated with a comment. Word 2013 features an improved commenting experience that does not display commenter initials by default. The APIs associated with the older commenting model have been hidden in the Word 2013 object model but remain available for backwards-compatibility. The "OM Hidden: Comment.Initial" issue in the indicates the file that attempted to use the API, the application that raised the event (Word 2013), the time and date of the event, and short description about the error and how to fix it.

Related

'File Not Found: VBA6.dll' Error - Strange Behaviour

I am running Windows 8 with Office 2013 (64-Bit). I am trying to continue developments in VBA in Excel that I started with Office 2010 (32-Bit). I am aware of the necessary 64-Bit alterations however I am receiving confusing configuration errors.
Here is the problem:
If I create a new Excel file and VBA project; all my VBA code functions correctly. No problems.
If I open and use a macro from a file that was developed/used in Office 2010 previously, I receive a "File Not Found: VBA6.dll" error message.
Once I start receiving the message, I receive it on all VBA macro's; even the new ones that (not more than 30 seconds) previously worked fine.
If I then re-create a new Excel file and new VBA Project, that individual piece of new code works fine. No problems - until I run code in one of the 'error files'. The fault then spreads into my new developments.
It's as if Excel is getting its references confused but every time I check them (on good or bad files) they are always exactly the same.
Note:
None of my references are missing.
I don't have VBA6.dll on my system; I have VBA7 and the 'Visual Basic for Application' reference refers too 'C:\Windows\SysWOW64\msvbvm60.dll'
There are two other 'Visual basic for Application' references on the list but it wont let me change them
It works on new files without VBA6.dll so I assume it isn't required?
I have checked for and installed all the latest Windows updates.
What should I do to troubleshoot this problem?
If you think I need VBA6.dll, is that because the referenced libraries use it?
If so then why are they not using VBA7?
And why does it work correctly before opening an old VBA6 file? Does Excel suddenly decide all files must use VBA6 just because one file did previously?
Anything to cure me of my confusion is much appreciated,
Best regards
EDIT: I almost forgot to mention;
When I try to debug the error after receiving it, Excel crashes (every time).
I also sent a 'bad file' to a colleague who [with the same system configuration] hasn't yet received this problem - and they also received the error. Suggesting it is something wrong with the files?
EDIT 2:
The problem is not yet resolved. I hope the downvote will not hinder my chances of an answer.
I have also tried re-registering libraries but nothing has changed.
If I open a 'bad file' I can add new Macros and they work fine; but the second I run an existing Macro and receive the error, the new Macros do not work either.
The error was caused during Office 2013 (64-bit) installation. The VBA7 DLL was not registered correctly so I had to open regedit and manually input the correct filepath in both
HKEY_CLASSES_ROOT\TypeLib{000204EF-0000-0000-C000-000000000046}\
6.0\9\win32
4.2\9\win32
Replacing the 'C:\Windows\SysWOW64\msvbvm60.dll' data value (mentioned in the question) for Visual Basic for Applications to the VBA7 DLL filepath. Which on my system is:
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.dll
All files now work; I hope this solves the problem for anyone else in the future.

Power Pivot Can't get data from the data model

I've had my PC since Sept 2014 and really want to use Power Pivot in Excel. I have Windows 8.1 64bit running stand alone Excel 2013 32bit (purchased Sept 2014)
I have never been able to get Power Pivot to load, the Add-in appears on the ribbon but only produces the errors described below.
I have MySQL installed, Visual Studio 2010 for Office Runtime (x64), Open Office with text only enabled.
I've run the Configuration Analyzer Tool (OffCAT) which only showed a problem with Outlook which is fine ( I think! ) as I don't use it and reinstalled both Excel and the add-in.
If anyone can shed some light on or solve this problem it would be greatly appreciated. I've read somewhere (forgot to bookmark) about editing script in one of the config files as there could be an accidental 'space' in the code, if I could find where I read that maybe that would help or solve this. I see somebody posted the exact same error elsewhere a few months back but received no answer so maybe this can't be rectified.
Here are the errors I recieve:
"We couldn't get data from the Data Model. Here's the error message we got:
The type initializer for 'Microsoft.Analysis.Services.XmlaClient' threw an exception.
Configuration system failed to initialize.
Root element is missing. (C\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine\config)
Root element is missing."
When I close this error another box appears:
Sorry, PowerPivot can't openthe Data Model because there was a COM exceptionwhile opening.
You might be opening a workbook on a corrupt installation of excel. Click Details for more information.
When I click 'Details' this appears:
============================
Error Message:
============================
Object reference not set to an instance of an object.
============================
Call Stack:
============================
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.CannotUpgrade(GeminiWorkbook geminiWb, WorkbookConnection wbConn, String& message)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSafeSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadOLEDBConnection(Boolean raiseCompleteEvent, String errorCache)
============================
I received a pointer from someone called 'scottsen' over at Mr.Excel who suggested I re-installed Microsoft.Net 4 framework.
So that's what I did and now it works just fine (til I find a way to break it!).
Case solved.

MS Excel - VBA Automation Error.

I have a suite of MS-Excel scorecard calculators that I send to 200 odd clients. In all client environments save 1 the calculators work 100%. However one client is experiencing the following problem.
Periodically the spreadsheet gets a Microsoft Visual Basic Run-Time Error. The exact message is:
Microsoft Visual Basic
Run-time error '-2147417848(80010108)':
Automation error.
As I mentioned, this happens only at one customer site. Everywhere else the spreadsheet runs 100%.
Can anyone shed some light as to why this happens at one site out of 200 odd.
It is possible to provide some diagnosis.
Do a search of user's system for any *.exd files. They may be in a hidden folder.
Delete any *.exd file you find. They are temporary files and will be rebuilt by Excel.
Try to run the file again. Sorry I can't provide more detailed help, but this is a start based on the information provided.

MS Access ignoring Microsoft Windows Common Controls 6 library

I am having serious problems with the Microsoft Windows Common Controls 6.0 SP6 library in Access. I have a number of scripts which were working fine before the weekend, but which fail lately on multiple different computers when they encounter the StrConv function. Here's a low-down on what's been going on:
Previously, all was working fine. On the afternoon of Friday the 20th (4 days ago), I began encountering some odd messages when I moused over a progress bar ActiveX control I had on one of my forms. This happened on the MouseMove, MouseDown, MouseUp and MouseClick events at least; the message reported was "The expression [MouseMove] you entered as the event property setting produced the following error: There was an error loading an ActiveX control on one of your forms or reports." I had registered none of the events mentioned on this control. Scripts in general were still working at this point.
Yesterday (after the weekend), I found that scripts I had written no longer worked. When encountering the StrConv function (which I was using to convert a string to uppercase), the VBA editor brought up an error message saying "Compile error: Can't find project or library." This function I'd imagine is quite a core part of the VBA language, but the only missing library I could find under Tools->References was "Microsoft Windows Common Controls 6.0 (SP6)". The missing file was listed as C:\Windows\system32\MSCOMCTL.OCX but this was present on the machine anyway. Browsing to it in the references dialogue made no difference.
Since then I have tried installing various different Microsoft Visual Basic redistributions, have followed the instructions at http://www.fmsinc.com/MicrosoftAccess/controls/mscomctl/, have phoned our company's tech support and have tried a system restore to a point where the scripts functioned previously, but nothing has worked. The database I am using resides in a networked folder on a server but the MS Access applications are local to the workstations.
Is there any way to resolve this issue?
Simply open one of the forms giving you trouble in Design View. Insert a new ActiveX object control in the form and save. Load the forms again. Hopefully this solves the problem. You can then safely delete the added control.

Word error when processing multiple documents

Right now we have a program that opens all of the word files in a folder and adds some information to the footer. After switching from Windows XP and Word 2003 to Windows 7 and Word 2007 we have started getting the following error:
Run-time error '5096':
EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCA
(c:\Users...\Content.MSO\8BE508C6.docx)
It occurs at random in any of the files (you can be 10 files in or 100). I thought that it might be a problem with the files being on a network drive so I modified the program to copy each file locally first, add the footer to that copy, and then copy it back out to the network. However, that didn't seem to work. I'm looking for any suggestions on how to fix the problem or possibly rewrite the solution. However, I need to keep the solution in VBA since this app is part of a bigger suite which in not ready for a .NET re-write.
As it turns out I was able to workaround this problem by copying the word files locally, running the main code on the local copies, then copying them back out to the network. It didn't seem to be working at first because the user's machine on which I tested it did not have the most recent version of the program.
Adding this note for those still looking for answers to this error...
I have a macro that creates several docs from one that is open based on sections in the main document.
I was getting the Run-time error '5096' and was an able to find any solutions that worked.
Upon further examination while debugging the code I discovered that while pulling data out of the main doc and building a file name that there was a carriage return after the file name and before the extension. After adding a replace statement to remove carriage returns I am able to process documents all day without an error.
I have found that the error is caused by the total number of characters in the file name is too long. This usually occurs when manipulating file names and the full path is set in the variable. I will manually chop pieces out of real long names to force it to work.
I suppose if I were smart, I'd move into the directory and just deal with the file names without the directory prepended to the name.