|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Code working in one sub routine, but not anotherI am using the following code in 2 separate sub routines:
Dim xlApp As New myExcel.Application Dim xlBook As New myExcel.Workbook Dim xlSheet As New myExcel.Worksheet xlBook = xlApp.Workbooks.Add xlSheet = xlBook.Worksheets.Add In one subroutine it works fine, in the second subroutine, i get a "Additional information: COM object with CLSID {00020819-0000-0000-C000-000000000046} is either not valid or not registered." error. Any ideas? Where exactly does it fail/throw the exception?
Jonathan Smith wrote: Show quoteHide quote > I am using the following code in 2 separate sub routines: > > Dim xlApp As New myExcel.Application > Dim xlBook As New myExcel.Workbook > Dim xlSheet As New myExcel.Worksheet > > xlBook = xlApp.Workbooks.Add > xlSheet = xlBook.Worksheets.Add > > In one subroutine it works fine, in the second subroutine, i get a > "Additional information: COM object with CLSID > {00020819-0000-0000-C000-000000000046} is either not valid or not > registered." error. > > Any ideas? On the second line, the " Dim xlBook As New myExcel.Workbook"
but i don't know why as the exact same code works in another subroutine in the same class Show quoteHide quote "Ahmed" wrote: > Where exactly does it fail/throw the exception? > > Jonathan Smith wrote: > > I am using the following code in 2 separate sub routines: > > > > Dim xlApp As New myExcel.Application > > Dim xlBook As New myExcel.Workbook > > Dim xlSheet As New myExcel.Worksheet > > > > xlBook = xlApp.Workbooks.Add > > xlSheet = xlBook.Worksheets.Add > > > > In one subroutine it works fine, in the second subroutine, i get a > > "Additional information: COM object with CLSID > > {00020819-0000-0000-C000-000000000046} is either not valid or not > > registered." error. > > > > Any ideas? > >
Distributed Programming
Dates at Midnight Rewriting the Textbox Obscure error Registering hot-keys for your Winform DatagridView comboboxcolumn - assign cell value [Regular Expression] match a word with interpunctuation Newbie Needs Help ! Find out the MAC-Adress of a server How to have .net code call pager or phone |
|||||||||||||||||||||||