Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim, my code is VB.NET so I don't think Set is an issue.
|
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I use a cell value as a parameter | Excel Worksheet Functions | |||
How to choose if I use a parameter or not in a parameter query | Excel Discussion (Misc queries) | |||
Collection as parameter | Excel Programming | |||
parameter problem | Excel Programming | |||
Parameter description | Excel Worksheet Functions |