View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default The parameter is incorrect

o,

As I understand it, VB.net does not use "Set" statements.
However, you code appears to be VBA?
If so, you must first declare the variable and then define it by
using the Set statement...
Set rngData = xlApp...

Jim Cone
San Francisco, USA


"overcanyon" wrote in message oups.com...
Thanks for the reply Jim.

Fact is I've tried that. If any of the parameters is the problem it may
be the second one. I did revert to hard coding a range in here to see
what would happen and the line runs ok... but that's not the point
really... the app still falls over later on. So I think this is a red
herring and there is something more sinister or fundamental going on
here. For what it's worth, the preceeding line is:

rngData = xlApp.ActiveWorkbook.Sheets("Raw Data Sheet").UsedRange
'rngData having been declared as Excel.Range