|
-
Nov 5th, 2010, 09:29 AM
#1
Thread Starter
Addicted Member
[RESOLVED] something wrong with Excel
I have been using Excel in vb.net for years and no problem but I have a new app and nothing is working. First I can't get Microsoft.office.interop referenced anywhere, which was weird.
Then I can't instantiate Excel App..
Dim pExcel_App as New Excel.Application -- this gives me error "New cannot be used on an interface??
But I can do this..
Dim pExcel_App As New Excel._ExcelApplication -- where did this come from?
Then I can't put anything into cells
Dim wkbSheet As Excel.Worksheet
wkbSheet.Cells(1,1) = "Title" --- this give me an error "Expression is a value and therefore cannot be the target of an assignment"
THe really weird thing is that I have an old app open at the same time that is just fine with all this code. AND the intellisense is different for each cell.
The good one sets is as a range, the bad one says it is an object???
I re-installed the MS PIA's but this didn't help.
I am totally stuck here??????
-
Nov 5th, 2010, 10:52 AM
#2
Re: something wrong with Excel
which version of the Microsoft Office Object Library are you referencing?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Nov 8th, 2010, 08:13 AM
#3
Thread Starter
Addicted Member
Re: something wrong with Excel
good question. I checked the app that is working used 2.2, mine is using 2.4. I removed and add MS Office 10.0 but it is still 2.4?? I would think I should be using the newest, but what are the changes now to use the objects??
I'm getting around some of the issues by using this statement
Dim pExcel_App As new Excel_ExcelApplication
but I cant put data into the cells, this won't work??
Dim wkbSheet As _ExcelSheet --> OK
wkbSheet.cells(1,1) = "test" --> doesn't work????
thanks
-
Nov 8th, 2010, 08:18 AM
#4
Re: something wrong with Excel
sorry i meant the Microsoft Excel Object Library...
i know the in 12.0 it's:
Dim pExcel_App as New Excel.ApplicationClass
but in 14.0 it's:
Dim pExcel_App as New Excel.Application
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Nov 8th, 2010, 08:49 AM
#5
Thread Starter
Addicted Member
Re: something wrong with Excel
Nic fast response Paul. You got me thinking about versions, there are so many!!!??? I removed what I had and added the following and all is good now..
1.Microsoft Office 11.0 Object Library
2.Microsoft Excel 11.0 Object Library
thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|