TheWaterbug
New Member
- Joined
- Feb 4, 2016
- Messages
- 15
- Office Version
- 2021
- 2019
- 2016
- 2013
- Platform
- Windows
- MacOS
Background:
Thanks!
- Many years ago Tektronix wrote some brilliant software (The TekVISA toolbars) to allow users to bring screen captures (or waveform data) from their oscilloscopes into Excel (or Word) with just a click.
-
- The software was free, and worked very well, and we used it all the time.
- It worked over GPIB, TCP/IP, or even Serial, though I never attempted serial.
- Then some stuff broke when we all transitioned over to 64-bit Windows and 64-bit Office, and much knowledge was lost.
- Their newer, 64-bit stuff is subscription-only
- I recently spent a few days figuring out what broke, and I got it working again!!!!! Short version:
- Install the 32-bit versions of Microsoft Office, TekVISA, and the TekVISA Toolbars
- Manually copy the toolbar template files to %OFFICEROOT%\startup and \xlstart
- Add those directories as Trusted Locations to the Office Trust Center
- Long version, with step-by-step directions and links, here.
-
- But in the intervening years I forgot how to do something that I'd figured out way back when:
- Back in 2010 I somehow found a way to call the TekXL Screen Capture macro in a loop from a user-defined macro.
- TekXL Screen Capture is normally called by a toolbar click, but I wanted to call it from other software.
- In our own application we changed a value in our hardware to move a signal, exported some of our internal data to Excel, and executed the TekXL macro to request a screen capture.
- After 100 loops I had 100 screen captures layered on top of each other, but if I renamed the .xlsx as .zip and unzipped, all the PNGs were in a separate folder with incrementing filenames, and then it was easy to turn them into a movie:
- I can't remember how I was able to call TekXL Screen Capture, but now I want to do it again.
- Actually I want to call TekXL Waveforms, but that's a bit more involved, so I want to start by seeing if I can just reproduce what I did back in 2010!
- If I look into the Tektronix toolbar code, it shows the following to install the toolbar button:
-
VBA Code:
Call AddToolbarButton("TekXL Screen Capture", "btnVHardcopy_Click", 190) '6, 527)
-
- and further down there's this function:
-
VBA Code:
Private Sub btnVHardcopy_Click()
-
- which calls:
-
VBA Code:
Call GetHardCopy
-
- But attempting either:
-
VBA Code:
Call btnVHardcopy_Click
- or
-
VBA Code:
Call GetHardCopy
-
- from a macro in another workbook results in:
-
Code:
Compile error: Sub or Function not defined
-
Thanks!