Need Help with VB in Excel

This is the place for all suggestions, releases and feedback regarding Milovana Hardware efforts.
Post Reply
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Need Help with VB in Excel

Post by Tzahrkiya »

Hey folks, this is a long shot but I`m wondering if theres anyone on the forums that knows there way around visual basic to help me try to fix an error...

long story short - found an excel macro which takes a song in wav format and converts it to be used as a stereostim track.

problem - when I click on the box to open select a song I get an error stating compile error couldnt find project or library (this happens as soon as i click the box I dont get an option to select a file)

now having google`d extensively I have been unable to find a solution but I am assuming I am missing a component of VB, however I have no idea how to check or install them :-s

could anyone offer some assistance?

thanks
kakarot
Explorer
Explorer
Posts: 9
Joined: Mon Aug 27, 2012 4:58 pm

Re: Need Help with VB in Excel

Post by kakarot »

in vba editor tools -> references, you probably need to check one of those libraries, not sure which one though,
but since it happens when trying to do a file pick dialog, probably one of the Microsoft libraries, some Microsoft item picker or something.

i think there will be something marked as missing, that could help in finding the culprit
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Re: Need Help with VB in Excel

Post by Tzahrkiya »

I did eventually find the missing library and got it installed...

however the macro is giving out runtime errors

http://www.mediafire.com/download/zw3zq ... c2Stim.rar

if anyone wants to have a look at it.. it is somthing I`d love to get working

rar file contains

excel sheet
source code
manual
dll of the library i was missing

Tz
Aardvark13
Explorer
Explorer
Posts: 12
Joined: Sat Jan 21, 2012 11:24 am

Re: Need Help with VB in Excel

Post by Aardvark13 »

Seemed to work Ok for me.

What was the error ? and what did you do to get the error ?
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Re: Need Help with VB in Excel

Post by Tzahrkiya »

I load the sheet up, I click on load file, i get the open file window so I select a test wav file I created. It loads the files as you can see it counting from 0 to 100% then I get a runtime error.

run-time error '-2147467259 (80004005)':

Method 'SetSourceData- of object'_Chart' failed


The debugger points to this line
Worksheets("Music2Stim").ChartObjects(1).Chart.SetSourceData Worksheets("work").Range(hi$), xlcolums

thanks for taking the time to look Aardvark13 :)
Aardvark13
Explorer
Explorer
Posts: 12
Joined: Sat Jan 21, 2012 11:24 am

Re: Need Help with VB in Excel

Post by Aardvark13 »

OK, I think the reason you are gettng errors is due to the WAV file that you are using. Try downloading this file

http://www.nch.com.au/acm/11k16bitpcm.wav

and using that as your input file.

If that works then it is likely an issue with your input file.

Technical Bit.

The reason it fails on that line is the range(hi$) part - basically Hi$ isn't storing the correct value and it screws up the chart object. If you look on the work tab in Excel, there should be 3 columns of data if the macro is working - if there are no columns you will get the error.

I'm not sure what your file is and according to the manual it should take CD format (44kHZ 16 bit Stereo). But I had issues with a CD track I'd ripped to WAV using Windows media player. It wouldn't even start the process, but skipping the line in the macro where it stopped I got the error on the line you mentioned.

I then used VLC player (which didn't play the media player ripped track) to convert the file to Audio CD format. This file worked as input in the Excel file with no issues - so maybe you could try this with your input file.
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Re: Need Help with VB in Excel

Post by Tzahrkiya »

Hey Aardvark13

thanks for really having a look at this. I couldnt download the wav you posted as I dont have quicktime but I did use audioconverter to try changing the file I was using to 11k16bit, also tried using vlc to convert to cd quality aswell still to no avail. Also tried a diferent file aswell various times :(

I still get the same error, even though all 3 lines in the work sheet are populated the error still persists..

guess it just doesnt want to work for me :(

again thanks for trying, much appreciated.
Aardvark13
Explorer
Explorer
Posts: 12
Joined: Sat Jan 21, 2012 11:24 am

Re: Need Help with VB in Excel

Post by Aardvark13 »

You don't need quicktime to download the file, just right click on the link and choose save as and save the file somewhere on your PC.

Or, if you upload your file somewhere and give me a link so I can download it, I can try and see if it works with your file or not.
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Re: Need Help with VB in Excel

Post by Tzahrkiya »

I still get the same error with your file :(
Aardvark13
Explorer
Explorer
Posts: 12
Joined: Sat Jan 21, 2012 11:24 am

Re: Need Help with VB in Excel

Post by Aardvark13 »

Ok.

Try deleting all the data from the 'work' tab and running it again.

Assuming it gives an error on the same line, go into the debugger, hover over the hi$ and see what it's value is, it should be in the format A1:C2000 (the 2000 may be different for you.)

Also, try changing xlcolums to xlcolumns (xlcolums is a typo). This didn't give me an error, but it is wrong so might help.
Tzahrkiya
Explorer At Heart
Explorer At Heart
Posts: 195
Joined: Wed Mar 19, 2008 7:03 pm

Re: Need Help with VB in Excel

Post by Tzahrkiya »

I did have a huge great big massive post in the writing and then I realised where the mistake was as you pointed out and it was stupidly simple :-s


Aardvark13 I couldnt have sorted this one without you though...

at every point where you would click ie, load file, extract rythmn, adjust level and then save file I was getting errors, through trying it now it seems to have been that one spelling mistake at each point.. I went through the debugger each time I got the error and corrected colums to columns and then resaved the macro with the corrections, it now seems to be working perfectly :w00t:

Edit* forgot to mention its working with 48khz files aswell :)

:thankyou: Aardvark13 :thankyou:
:clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:
Aardvark13
Explorer
Explorer
Posts: 12
Joined: Sat Jan 21, 2012 11:24 am

Re: Need Help with VB in Excel

Post by Aardvark13 »

No problem. Glad I could help. Bit annoyed that i missed the typo on that line, but it worked fine with the error for me. That's computers I suppose.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests