Why do I receive the error "The first argument 'channel' is not valid" when using the function DDEREQ on Windows 64-bit with MATLAB 7.7 (R2008b)?
Show older comments
I have code that retrieves data from Excel through the DDE inteface. The code works fine on Windows 32-bit. However, when I run the code on Windows 64-bit, I can only call DDEREQ exactly 63 times, at the 64th time, an error is thrown.
Reproduction steps:
1. Open an Excel file and enter a value in a cell. Define an alias for the cell with the name 'Dummy'. Keep Excel open.
2. Run the following code in MATLAB:
for i=1:100
exChannel = ddeinit('Excel', 'Sheet1');
% Read cell marked as 'Dummy'.
% Crashes at i=64 on Win64.
retValue = ddereq(exChannel, 'Dummy');
rc = ddeterm(exChannel);
clear exChannel;
end
On Windows 64-bit, the following error will occur on the 64th iteration:
??? Error using ==> ddereq
The first argument 'channel' is not valid.
Accepted Answer
More Answers (0)
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!