Topic: Excel VBA crashes with Scomm32
|By: Jean-Marc||Posted on: Mar 30 2017 at 08:56:01 AM|
I use Scomm32 driver to communicate between electronic boards and EXCEL VBA on a first computer. All is OK but yesterday I installed Scomm32 driver on a secund computer and I noticed that EXCEL crashed when I closed it. The differences between the two computers are numerous but I think one is important : only on the secund computer there are two softwares called "Microsoft Visual Studio 2010 Service Pack1" and "Microsoft Visual Studio 2010 Tools for Office Runtime (x64)". If I install the application which installs these two softwares on the first computer, EXCEL will crash, too. So I suppose the problem comes from the two softwares.
Have you already seen this problem ? And how to solve it ?
For the first computer I can remove the application with the two softwares but I would like to keep them on the secund computer.
Thanks or your help.
|By: Support ||Posted on: Mar 30 2017 at 03:35:20 PM|
|I notice you mentioned (x64). I assume you do know that SComm32 is a 32bit ActiveX component and can't run in 64bit applications.|
It works fine on 64bit versions of Windows. The problem is 64bit versions of MSOffice/Excel
The default installation of MSOffice, even 2016, is 32bit. That's the version they want you to install.
If you have the 64bit verion of Office then you must have gone out of your way to install it and should know that many ActiveX components, even from Microsoft, will not even show up in the list of available controls.
Developing in VBA and using 32bit ActiveX components in 64bit version of Office is not possible.
|By: Guest||Posted on: Apr 1 2017 at 08:55:23 AM|
|When you install MSOffice it does not offer the option to install 32bit or 64bit version. It will automatically install the 32bit version without even telling you.|
If you did install 64bit Office then you must have specifically gone searching for the 64bit installer. If you're using MS's OnLine installer then it is still possible to install the 64bit version of office but you really have to be pretty tech savvy and go looking for the (hard to find) tools to it.
So. Microsoft is not making it easy to install 64bit Office. They simply don't want you to install it. So don't install it unless you really, really need to.
ONLY install 64bit office if you need to create huge (and I mean Mega HUGE) spreadsheets with some serious number crunching. Once your sheets get over a specific size the sheets can no longer be opened, not even read, by 32bit office users.
I suppose a company might choose the 64bit version and ensure that all users have that same version.
But if your company uses VBA in any way then you should stick to the default 32bit. If you do have a user with 64bit office then that user will NOT be able to open any sheets that contain 32bit ActiveX components.
|By: Guest||Posted on: Apr 2 2017 at 12:47:28 PM|
|Thanks for your answers.|
Only 32 bit office are installed on my computers.
I think I made a mistake : now, on only one computer, EXCEL crash when it is closed. I have installed the same softwares on another computers and there is no problem. So it is not the reason of the crash ! So there is a problem but where? it is too difficult for me to find the solution. I don't know where to search... I think the better way for me is to "clean the computer".
Thanks again for your explanations.
|By: Guest||Posted on: Apr 3 2017 at 07:08:49 PM|
|You said "Excel crashes when it is closed".|
Do you mean "Excel crashes when Excel is closed"
or do you mean "Excel crashes when Serial Port is closed".
What happens if you open the excel sheet and close it again without opening the serial port. For example does the excel crash only occur if the serial port was opened.
Does the behavior change if you close the serial port before closing excel?
If you can try a few different things it may help somebody track down the problem.
|By: Fabio Milanesi||Posted on: Apr 8 2017 at 12:38:26 PM|
|I have similar problem with Excel Professional 2010 32 bit italian language under windows 10 64 bit.|
Excel Version 14.0.4760.1000 (32 bit)
The excel sheet opens the form with scomm control called CommW
The program works until the instruction a = commW.input ( the opening command and the output command are ok )
Excel crash only at the instruction a = commW.input
This is the code :
If porta = 1 Then
Me.CommW.Output = "*IDN?" & vbCrLf
Pausa 0.1 ' pausa is a sub for wait 0.1 second
a = Me.CommW.Input
If InStr(1, a, "NEW", vbTextCompare) > 0 Then Exit For ' Else Me.CommW.PortOpen = False
Me.CommW.PortOpen = False
Thanks for your support
|By: Guest||Posted on: Apr 10 2017 at 01:18:59 PM|
|Instead of .Input can you try it with .Read|
So, to use your example:-
a = Me.CommW.Read
What happens now?
Reply - add a comment to this topic.
You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected.