Help with VBA Macros

locoman

New Member
Joined
Oct 13, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi
My knowledge of macros in excel is very limited. I am trying to make a button in excel that has 3 actions associated with it. I am using the Data Streamer Add-On to record sensor data from an Arduino. Everything works fine but I need to automate the process to record for a set period of time and then stop recording. I am trying to use CommandBars.ExecuteMso "" but can not find the idMso for the Record Data and Stop Data buttons on the Data Streamer Ribbon. When I hover my mouse over the button names in the Customize Ribbon option it simply says "Macro: ButtonClick" for all of the button under in this ribbon. So my question is this???
How can I make a button in the "Data In" tab that starts the data recording and then stops recording the data after a 5 minute interval?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I have never used the Data Streamer add-in. However, after researching on the internet, its use appears very straight forward.

The first thing to be determined (because I was unable to locate any VBA macro code to do the same) is determine if the MACRO RECORDER will capture starting and stopping
recording with the Data Streamer.

Follow these instructions :


Attach your device to the computer.
Go To :
Developer Tab
Click on Record Macro
Go To :
Data Streamer Tab
Click:
Record Data - let run for approx. 30 secs.
Stop Recording.
Go To :
Developer Tab
Click on Stop Recording
Go to the VBE and examine the macro just created by the Macro Recorder.
Does the code include instruction to START and STOP the Data Streamer Recording ?

Post the code created so it can be reviewed.
 
Upvote 0
Hi Logit
I tried what you said and nothing happens this is line of code for the macros
Sub Macro1()
'
' Macro1 Macro
'
'
End Sub


I then tried to create a button with the macro but nothing happens
 
Upvote 0
Ok ... that confirms that the MACRO RECORDER will not record your actions relative to the menu selections.

I'll continue to search for some code on the internet that might assist in running the record function. If I find something ... I'll get back to you.
Perhaps someone else with experience using the add-in can assist in the meantime.
 
Upvote 0
I have not located anything in VBA related to running the recorder. I did find one resource that uses Python to record a .CSV file
that can later be downloaded into Excel : Arduino Data Logger (CSV) with Sensors and Python

I am not certain how you would automatically start the Python file. Perhaps you could utilize the Windows Scheduler that is built-in
to Windows.
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,561
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top