[BNM] call something from Excel VBa

Jason Bailey j.bailey at sussex.ac.uk
Thu Jun 22 15:45:37 BST 2006


Hello,

I'm trying to help someone create a WAV format file and noise by selecting 
some data (probably a frequency value to create a sine wave) in Excel.

I can see in Excel how to create code to call an already existing WAV and 
play it. I've also found some Visual Basic which will create a WAV file and 
play it. I've found the following code:
<http://groups.google.co.uk/group/comp.lang.basic.visual.misc/browse_thread/thread/affb905712a7b245/6f593e46fed8ebb9?lnk=st&q=create+waveform+file+with+visual+basic&rnum=6&hl=en#6f593e46fed8ebb9>

I guess therefore I can create a VB (not excel VBA) EXE or ?? to do part of 
this.

My question is what is the best, in your opinion, way to do this? I guess I 
need to give control to Excel (VBA) (Excel is the package the person wants 
to use for various reasons). Call this code in some way and return control 
to Excel. My VB/VB Net is OK. I'm thinking I need to create a DLL. Is this 
actually possible in VB (C/C++ etc I can see but not VB maybe). Should I 
create a COM? Should I exe and somehow pass the value as an argument. You 
can probably tell I've not done this before and so am a bit stuck. I've 
created VB applications that call on Excel etc but not the other way. Is 
there a difference?

Could you give me your take on this?
something like

'  excel vba code

dim freq as integer

freq=3

' do something with freq to stick send it to an EXE/DLL or Com? I'm not sure
' Another option which would probably simplify it would be to get Excel to 
create a file
' containing the value 3 and then get the exe/com/dll to load the file and 
get value.

' end

Thanks
Jason

p.s. I'm asked to do this with Windows/Excel. I found a free OS copy of 
matlab (www.mathworks.com which is good for this kind of thing) call SciLab 
but it looks like Excel is the weapon of choice.



-- 
Jason Bailey
IT Services
University of Sussex
http://www.sussex.ac.uk/USIS/phone/details.php?id=17011



More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service