02-22-2007 04:29 PM
02-22-2007 05:41 PM
02-23-2007 08:47 AM
02-23-2007 09:06 AM
02-23-2007 11:28 AM
Dennis,
This is what I'm after, but I'm having a slight problem. After building the exe like you said, and adding it as a reference in excel's vba, I come across an error in my code.
Sub LoadData()
Dim frapp As FrequencyResponse.Application
Dim vi As FrequencyResponse.VirtualInstrument
Dim paramNames(4), paramVals(4)
Set frapp = CreateObject("FrequencyResponse.Application")
vipath = "C:\Program Files\National Instruments\LabVIEW 7.1\examples\apps\Frequency Response.exe"
Set vi = frapp.GetVIReference(vipath)
Everything works, but when I get to the last line of "Set vi =..." it returns the error, unexpected file type. Is this because it is calling an exe and not a vi? Any help would be greatly appreciated.
I've made this code by following the afore mentioned example, but using the Frequency Response activex controls.
02-23-2007 12:52 PM
I was afraid you were going to ask me a VB question. I haven't done any VB programming in a long time and I've only tried to control a LabVIEW exe from a LabVIEW VI. The only thing I can think of at the moment is to make sure the app you created is registered as an ActiveX server. Here's an older post that mentions how to do it and also has an Excel macro that might help.
http://forums.ni.com/ni/board/message?board.id=170&message.id=127040&query.id=268934#M127040
02-23-2007 01:06 PM