I have a COM dll that works fine in a excel 2007. I'm trying to get it work with excel 2010, and it seems to work fine at first, and then the excel suddenly cruses, and produce a .dmp file.
Does excel.interop version 12 can be used on excel 2010?
Is it possible to examin the dmp file that produced after the crush, and if so how? (tried windbg, i have no idea how to use it)
Thanks
Excel.Interop version 12 should work with Excel 2010 because COM components must be backward compatible (the interfaces found in Office 2010 must be compatible with the ones that exist in Office 2007)
The first step to carry out with your dump file is to load it in the debugger, setup the symbols correctly ('.symfix') and then launch the '!analyze -v' command. If the produced analysis and the callstack doesn't help you to pinpoint the problem, then you'll need advanced skills to debug the problem (memory corruption, debugging, ...).
Related
I have code for an excel add-in I wrote over 20 years ago that I find myself needing again. It works fine in Windows XP and Excel 2003 in a virtualbox. In the VB6.0 IDE, I can load the code and make the dll which I can register as an excel add-in and use it in Excel 2003 within the virtual box. I can also use the VB6 IDE to debug it. I am looking to do the minimum to rewrite this for a short-term need to share with a small set of people in an organization using a current 64 bit version of Excel. They are in a locked-down environment so having them all run an old 32 bit version of Excel for this functionality is not an option.
Is there a version of Visual Basic which allows compiling for 64bit? I find references to what sounds like a VB7 IDE that would allow this. If it does exist, is it possible to get ahold of that anywhere? And will it actually make an add-in that will work with a current 64-bit version of Excel?
You can set registry entries to allow x64 to load x32 libraries.
So COM ignores bitness in EXE files. So any EXE file can be loaded by any COM client (and vice versa though no one cares). By setting registry entries you force your DLL into DLLHOST.exe.
COM loads a 64 bit stub into Excel and communicates to the stub. As far as Excel can tell it has loaded a 64 bit dll.
One problem is that one registry key you don't have permission to change. You must take ownership and give yourself permission to add an entry. There is no inbuilt tool to do this automatically, unlike for files.
This following reg file enables the MSScript Control, which allows you to execute VBScript and JScript as macro languages. Microsoft wants to kill VBScript and JScript and MS Script Control. So it is only available as a 32 bit dll for compatibility. It takes under a minute to add macro languages to any program. Contrast to VBA which you have to pay to use. Note the one line that requires TakeOwnership.
Windows Registry Editor Version 5.00
;MSScript.reg
[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
#="ScriptControl Object"
"AppID"="{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}"
[HKEY_CURRENT_USER\SOFTWARE\Classes\Wow6432Node\CLSID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
#="ScriptControl Object"
"AppID"="{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}"
;This one needs to be done manually
[HKEY_CURRENT_USER\SOFTWARE\Classes\Wow6432Node\AppID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
"DllSurrogate"=""
[HKEY_CURRENT_USER\SOFTWARE\Classes\AppID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
"DllSurrogate"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
#="ScriptControl Object"
"AppID"="{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
#="ScriptControl Object"
"AppID"="{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\AppID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
"DllSurrogate"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}]
"DllSurrogate"=""
The reference is here but only DLLSurrogate is of interest to you - https://learn.microsoft.com/en-us/windows/win32/com/appid-key.
A more of a background reference - https://learn.microsoft.com/en-us/windows/win32/winprog64/process-interoperability.
I recently installed the spreadsheet link ex add-in on my excel 2013, but it doesn't work. When I try to choose the option 'Start MATLAB' from MATLAB field in HOME Ribbon it gives me an error:
'Cannot run the macro 'ribStartMatlab'. The Macro may not be available in this workbook or all macros all disabled.'
The same thing happens with any other MATLAB command chosen from excel.
I chose the option 'Enable all macros' in the Macro Security Settings and also checked the box 'Trust access to the VBA project object model'.
I also checked the SpreadsheetLink2007_2010 reference in the VBA->Tools->References (none other is available).
I found some information that the version of SP for Office might be put to blame but I checked and it seems I have the latest version of SP1 for Office 2013.
The exact name of the add-in is 'Spreadsheet Link EX 3.2 for use with MATLAB and Excel', the Office version is 2013 Proffesional Plus, and the MATLAB version is 2013b. Any help or tips greatly appreciated.
this is more of a guess than anything else. But I'm guessing the ribbon/macros use activeX control. at the end of last year there was an update to excel that disables activeX, which usually results in strange performance or code breaking with very cryptic error messages. It's a bit complicated to get it to work again, but here is a post that might provide some insight http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2015/03/11/forms-controls-stop-working-after-december-2014-updates-.aspx
again, this is really a guess, I don't know for certain the matlab commands use activeX but it's worth looking into
After finishing an add-in I started testing it on other computers. There is this one computer that I get the following message:
Can't find project or library
Note: This computer is running Excel 2010 and I've tested it successfully only on Excel 2013 computers. They both have the same references as shown bellow:
Prompt me if any other information is necessary:
MS Office 15 is the library of code that is delivered with office 2013.
As your code is using early binding (google it), you need a reference to a library that has the same code for your code to use when working with 2010.
Older version of excel came with an older library that has an older version of the same code (with some extra bits too). You need to change the reference in the file when using the workbook on older version of excel OR change your code to use late binding.
It might be easier for you to simply change the reference and save the file as "Myfielname 2010version" and use this copy with excel 2010 and a different file with excel 2013.
Excel 2010 library will have the same name but with a different number (eg 13) and you will find it further down the list.
You can add code that detects the version, but you don't want to go there.
First I've just realized the reference list is for each workbook/add-in and not for the system as a whole. There was a missing reference to the solver add-in on the other computer. VBE doesn't run the project with a missing reference. I will post how to automatically check and add it here when I find out How.
I have an Excel application, with lots of macros in it. The macros in the workbook are signed. Some of the macros call Windows API functions and they have been ported to support 32-bit and 64-bit versions of Excel properly. The application works fine on different configurations (Windows XP, Windows Vista, Windows 7, Windows 8, Excel 2003, Excel 2007, Excel 2010, even some Excel 2013).
The application has been developped on a PC with Windows XP and Excel 2007, using the French Canadian locale.
I have one customer that has the following setup:
Laptop with Mac OS/X
Virtual machine with:
Windows 8 English
Excel 2013 English
When he runs my application, he always gets a Runtime error -2147319784 (0x80028018).
I tried to pin point where the error happens and it seems that as soon as the macros execute something referring to the Excel Object Model (for example: Application.ScreenUpdating = False) I get the error.
I tried to copy the exact line of code that fails in a new Workbook and it works fine without any error.
I have already seen a similar behavior in other versions of Windows and Excel with english versions of the products, and the way to solve the problem was to change de regional settings to US English. I tried it on my customer's machine and it didn't work.
I searched the web and found similar issues with Excel 2002 and I found a post in the Microsoft's Knowledge Base (http://support.microsoft.com/default.aspx?scid=kb;en-us;320369). This post applies to .NET VSTO applications, which is obviously not my case here. I can't change the current thread's locale as suggested in the article since this is not available from my VBA macros. I tried to copy the Excel.exe file to a 1033 folder and rename it to xllex.dll as suggested, but it didn't work either.
I even asked my customer to completely uninstall all Office products from his machine and just reinstall Excel 2013. Still doesn't work.
Honestly, I'm running out of options here... Can anyone help me solve this problem?
Thank you for your help!
Ghis
"Windows API functions" in a Mac. Can't imagine that'll work. Is your error this? "Old Format or Invalid Type Library" I'd say your code is not compatible with Mac somehow.
I don't know why the code would fail on a minor issue like Application.ScreenUpdating = False; but you already concluded that line by itself wasn't the problem anyway.
Sounds like you'll need to rewrite your code for the Mac.
i have an excel file template and i want save the written value in textboxes to the cells of excel using vb6 language.
can anyone help me?
You can do this using Excel's automation features from any language that supports COM (directly or indirectly); here's an example using VB.Net. There are also examples using VB6 out there still, but see my comment on your question, creating new applications with VB6 is a potential problem as the dev environment (compiler, for instance) is no longer supported (the runtime still is, for a little while yet, to support apps that already exist). The dev environment still works (under XP, at least) to my (sad) knowledge, but expect it to start having trouble as OS's move on...