ActiveX scripting "Record" command not working properly in WaveLab Pro 11.1.20

I recently moved from WaveLab Pro 9 to 11 and I can no longer get the “Record” command to work
properly using ActiveX scripting. I used this for a few years in WaveLab Pro 9 without any problem.
My script to open the Record window is called from VBA code in Microsoft Access as follows:

Set oWavApp = CreateObject("WaveLab9_1.Application")
While oWavApp.IsReady() = False
Set oRecordWindow = CreateObject("WaveLab9_1.Recorder")
oRecordWindow.Open "Wave - 44.1 - 16-bit (Record)"  ' WAV Preset
oRecordWindow.Record "W:\temp\Test1.wav"

WaveLab 9 will then open and start Recording to the Test1.wav file.

Running the same code for WaveLab 11 (replacing “WaveLab9_1.Recorder” with “WaveLabPro11.Recorder”)
will open the Record window but does not start Recording the Test1.wav file.
If I then manually press the Record button it pops a message saying the file is already
Opened so it can’t Record to it.

It seems like it is opening the file somehow in the background first
before the Record window opens because if I add these 3 additional lines after the last
oRecordWindow.Record statement then it works.

Sleep 1000
oRecordWindow.Record "W:\temp\Test1.wav"

So this is a workaround for me at the moment but is not ideal since I have to call
oRecordWindow.Record twice and also hope that the Sleep time is enough to allow
the “open” file to be Discarded before the 2nd .Record command.

In addition, I also notice that if I try to Record to a FLAC file instead of WAV,
the .Discard and .Stop commands do not work at all and just leaves the FLAC file Open.
I have to Exit Wavelab before I can access the FLAC file.

I will investigate this, but this will take a few days to answer.

Ok, thanks!

I have checked it with WaveLab 11, but the problem you describe about “the file already exists” , eg. “W:\temp\Test1.wav”, only happens if this file does exist.
If I run your script, providing a file path that does not exist, the recording happens without a problem.

So I guess this is just a problem with WaveLab 11? I was testing in an empty folder when recording to the Test1.wav filename, along with Test2, Test3… so I know they didn’t already exist before running the script. Is WaveLab 12 coming out soon? I guess I can just go back to using WaveLab 9 for now when using this script, although I haven’t had WaveLab 11 that long and was hoping to use it for all of my tasks.

There was a typo in my previous message: I meant: “I have checked it with WaveLab 11.2”.
IOW, I can’t detect your issue with the version you are using.