The code was designed by someone. While testing I'm getting error in the code
IntnumbOfchild = Run("ELCOMPN", STRdIM, strTest1st)
Can you tell me if its related to tm1? When do we use RUN command? I cannot find the macro of this name in the project
Run is not a procedure of the standard libraries in VBA.
Thus, select the word "Run" it with the mouse cursor, and press F2:
Take a look where the VBEditor brings you.
Try to debug there.
Related
I am working on a VBA GUI that I have not developped by myself.
I do not really know VBA langage and I need help.
I am trying to drive an electronique card plugged as USB with that GUI.
The problem is that I am trying to use NETComm.ocx to send instruction to the device but I have an issue that is knowed by the GUI developper and voluntary ignored because he does not have the issue. It seems to depend of the computer.
I am adding NETComm.ocx and MSComm32.ocx files to the path where Excel VBA is looking for them. When I check in the References panel, it seems to work well but when I am executing the code, I have a
"Run-time error '424' : object required.
When I clic "Debug" it highlight the following line :
NETComm1.CommPort = VirtualCommPortNumber
VirtualCommPortNumber is an integer.
It seems like it does not know NETComm but I do not know how to do to fix that.
Thanks for your help.
Titouan
You need to Copy NETComm.ocx and MSCOMM32.OCX to C:\Windows\System
I think the Paths are hard-coded in these files, so they can be only registered from here.
Run cmd as administrator and
Type regsvr32 C:\Windows\System\NETComm.ocx and ENTER
Type regsvr32 C:\Windows\System\MSCOMM32.OCX and ENTER
Resource:
https://info.kmtronic.com/control-kmtronic-relays-via-excel.html
I am in heavy debugging mode where I have to restart the kernel fairly frequently, and am making heavy use of lots of cells in Spyder. When I am about 10 cells in and this happens, it would be really nice to be able to just run all cells above the current cell, sort of like you have in Jupyter.
I know I can manually go through and run cells 1-9 with Shift-Enter, or I can select all the code manually and hit F9. Is there a shortcut?
(Spyder maintainer here) There's no shortcut and no way to run all cells above or below the current one.
However, I think this is a very valid concern, so please open an issue in our issue tracker so we don't forget to implement it in a future release.
I usually just create a syntax error where I want to stop execution and then press F5.
EDIT:
It just occurred to me that this isn't quite right. A syntax error will prevent execution from starting. What I actually do is provoke a NameError:
NameError: name 'stop' is not defined
In Jupyter Notebook the shortcut for run cell/select below is Shift+Return. The issue I have is that it selects the below cell in Command mode and not Edit mode, therefore requiring an extra step each time to go into Edit Mode.
Question: How can I change that, and is that a possibility?
Here are some images to make it a bit more clear in case I wasn't. Nevermind apparently need more Reputation before I can embed pictures, Sorry for the inconvenience.
Before Run cell/Select Below (Shift+Return)
After Run cell/Select Below
What I want
Thanks in advance for you help!
I imagine you're looking for the 'Run cell and insert new cell below'
You need Alt+Enter for that
https://kapeli.com/cheat_sheets/iPython_Notebook.docset/Contents/Resources/Documents/index
If it is inconvenient to use, you can try changing the shortcuts.
Follow:
https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Custom%20Keyboard%20Shortcuts.html
I am running an SSH into a linux computer. The MATLAB GUI can be very slow and unresponsive. Is there a way I can use MATLAB in command line mode so that I can highlight part of my code and run that section? In GUI, it is possible to do this in the Editor window by right clicking and choosing 'Run Selection' or by pressing F9. In command line mode, I only know how to run the entire script.
In a similar vein, can I run a section of the code (the 'Run and Advance' button in the GUI) using command line?
Also, is it possible to see the workspace (like the Workspace window in the GUI version) from the command line?
AFAIK there is a no-desktop mode in MATLAB, which you can access by running it with -nodesktop parameter, this should provide you with what you need. You can find more info on official MATLAB pages
As Niemand said you can start MATLAB with the flag -nodesktop.
You won't be able to select and run a potion of code with -nodesktop. You could just put that chunk of code in a separate function or script and call that.
If you're doing a lot of work without the GUI I would recommend looking at http://matlab-emacs.sourceforge.net. This is a MATLAB mode for Emacs that provides many of the same functionalities as the MATLAB desktop.
Lastly check out who and whos to see the workspace variables.
When typing in the editor it puts me back on the end of the last word.
For example, I want Sub Entername()
If I'm not typing quickly enough it goes: SubEnterName().
How do I turn this off.
I've heard of this problem before. Try these steps:
Close down excel.
Open it first it in safe mode (type "excel.exe /s" in the run box).
Open the VBA Editor and attempt to write a macro. The issue should not occur
Close down excel and re open it normally
I've heard these steps have fixed this issue before for others.
Are you using any VBE addins like Smart Indenter or Code Cleaner? Remove Code Cleaner and install it only when you are going to use it, then uninstall it when you are done. I had the same problem and Code Cleaner was the culprit. I believe it might be the two of them together that causes it.
For reference:
VBA Code Cleaner
Smart Indenter
This issue is because of a COM Add-In called 'Load Test Report Addin'. to disable it, do the following:
go to Excel Options -> Add-Ins and choose Excel COM Add-ins from bottom drop down and press Go... button. then uncheck the 'Load Test Report Addin' item to diable it. this will clear the problem!
To prevent auto refreshing and deleting back-spaces in VBA editor, you should make sure that all forms or reports that have On-Timer Event Procedures are in design view or the code should be turned-off (i.e. converted into comments).
However, it is better to make sure that all forms and reports are in design view which means none of the On-Timer codes are executing.
I hope this helps.
Shafiu.
Do you have AutoSave turned on? I had a file doing this just now. While typing, as SOON as I stopped, AutoSave was working away - (inadvertently, I'm sure) this was causing VBE to kill spaces.
Did two tests:
-Moved the file off Sharepoint onto my local machine, worked fine
-Turned off AutoSave on the Sharepoint copy, worked fine