PDA

View Full Version : Modifying Excel Worksheets from VB


simmo
05-01-02, 03:09
I'm having problems modifying data in an excel worksheet from my VB program on an NT system. It works fine through the use of the GetObject() function and simply modifying the worksheet (e.g x.WorkSheets("x2").Range("x3").Value = x4) on my XP machine but i get a runtime error 'Automation Error - Incompatible version of the RPC Stub'

Any ideas?

rnealejr
05-01-02, 17:06
This article may help:

Article (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q177446)

Is the xp machine the same machine where you create your programs ?
Does this error occur on all nt machines ?
Can you send your code ?

simmo
05-01-02, 22:58
Thanks for the help....

i've fixed that problem....problem when it packaged XP .dll's on NT stuffed things up. But now i have another problem on a 95 machine says ActiveX component can't create object when trying to connect to the spreadsheet.

The code was built on my XP machine for connection to Access 2000 and Excel 2002. The 95 machine has access on it but not excel, but i assumed that when i used deployment that the drivers would be packaged?

Code:

On Error GoTo Err2
Dim exwk As Workbook
Dim exwk2 As Workbook
...
exName1 = "Product Costing - Criteria.xls"
exName2 = "Product Costings-ver3.xls"
....
exwk.Worksheets("New Costings").Range("C3").Value = 4 'Produces error
....

rnealejr
05-02-02, 18:48
MS give something away for free ? Shame, shame, shame :-). Big Bill has to reach the 100 billion mark next year. But seriously, you hit the nail on the head - the 95 client needs excel installed. The error you received basically means that the object has not been registered and since it was not installed ...

The following is a helpful article that goes into more detail:
MS Article (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q249843)

Good luck.