Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default The parameter is incorrect

Hi folks,

I have an application that generates spreadsheets. It is developed in
VB.NET 2003 and works well on XP with Excel 2003. Have tried to deploy
this on Windows Server 2000 with Excel 2000 only to get an error 'The
parameter is incorrect'. This error occurs on the follwing line:

ourPivotCache =
xlApp.ActiveWorkbook.PivotCaches.Add(SourceType:=x lDatabase,
SourceData:=rngData)

I don't think there is anything wrong with this line, bear in mind this
app works perfectly on XP against Excel 2003.

Now.. in an effort to fix this problem, I went and built this app on
the Windows 2000 server with VS .NET 2003 having changed the reference
to the Excel 9 library. Still no luck.

One thing worth noting here is that if I invoke Excel 2000 manually, a
message box appears with 'Cannot use object linking and embedding'. Is
this something to do with the problem, I don't know.

Anyone any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default The parameter is incorrect

o,

This is just a guess.

Try replacing the Excel constant "xlDatabase" with its numeric value...
SourceType:=1
or
Try qualifying the constant with the application object...
SourceType:=xlApp.xlDatabase

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"overcanyon" wrote in message
Hi folks,
I have an application that generates spreadsheets. It is developed in
VB.NET 2003 and works well on XP with Excel 2003. Have tried to deploy
this on Windows Server 2000 with Excel 2000 only to get an error 'The
parameter is incorrect'. This error occurs on the follwing line:

ourPivotCache =
xlApp.ActiveWorkbook.PivotCaches.Add(SourceType:=x lDatabase,
SourceData:=rngData)

I don't think there is anything wrong with this line, bear in mind this
app works perfectly on XP against Excel 2003.
Now.. in an effort to fix this problem, I went and built this app on
the Windows 2000 server with VS .NET 2003 having changed the reference
to the Excel 9 library. Still no luck.
One thing worth noting here is that if I invoke Excel 2000 manually, a
message box appears with 'Cannot use object linking and embedding'. Is
this something to do with the problem, I don't know.
Anyone any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default The parameter is incorrect

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default The parameter is incorrect

If the primary interop assembly is not installed in the global assembly
cache, Visual Studio generates an interop assembly for the project that
might not work fully in all cases. For more information, see Troubleshooting
in Office at Run Time.

http://msdn2.microsoft.com/library/6s0wczt9.aspx

--

Regards,

Tom Ogilvy



"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



  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default The parameter is incorrect

Tom, I have looked at the link you suggested. The instructions for
installing the primary interop assembly (and the article in general)
appears to be aimed at Excel 2003. (I tried but was not given the
option for .NET Programmability Support)

Are primary interop assemblies available for Excel 2000? I've seen much
reference to PIAs but this always seem to refer to later (than 2000)
versions of Excel. Is there a separate remedy for this version?

Thanks.

Tom Ogilvy wrote:

If the primary interop assembly is not installed in the global assembly
cache, Visual Studio generates an interop assembly for the project that
might not work fully in all cases. For more information, see Troubleshooting
in Office at Run Time.

http://msdn2.microsoft.com/library/6s0wczt9.aspx

--

Regards,

Tom Ogilvy



"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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default The parameter is incorrect

Jim, my code is VB.NET so I don't think Set is an issue.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default The parameter is incorrect

I code without a .NET, so I can't tell you.
Look at this link:
http://www.dicks-blog.com/archives/2...rt-classic-vb/

Stephen Bullen is the author. In the responses, look at item #8 also
written by Stephen.

This may give you a clearer pictu

http://msdn.microsoft.com/office/arc...ych2_part1.asp

--
Regards,
Tom Ogilvy



"overcanyon" wrote in message
ups.com...
Tom, I have looked at the link you suggested. The instructions for
installing the primary interop assembly (and the article in general)
appears to be aimed at Excel 2003. (I tried but was not given the
option for .NET Programmability Support)

Are primary interop assemblies available for Excel 2000? I've seen much
reference to PIAs but this always seem to refer to later (than 2000)
versions of Excel. Is there a separate remedy for this version?

Thanks.

Tom Ogilvy wrote:

If the primary interop assembly is not installed in the global assembly
cache, Visual Studio generates an interop assembly for the project that
might not work fully in all cases. For more information, see

Troubleshooting
in Office at Run Time.

http://msdn2.microsoft.com/library/6s0wczt9.aspx

--

Regards,

Tom Ogilvy



"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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a cell value as a parameter Richhall[_2_] Excel Worksheet Functions 5 January 6th 08 05:02 PM
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
Collection as parameter stefantem[_15_] Excel Programming 2 January 13th 06 01:01 PM
parameter problem Gixxer_J_97[_2_] Excel Programming 3 June 3rd 05 05:32 PM
Parameter description Davids Excel Worksheet Functions 1 May 2nd 05 12:09 PM


All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"