|
-
Feb 10th, 2012, 03:48 AM
#1
Thread Starter
New Member
Helpppp me with coddeeeeeee
Last edited by Hack; Feb 10th, 2012 at 06:53 AM.
Reason: Added Highlight Tags
-
Feb 10th, 2012, 03:54 AM
#2
Lively Member
Re: Helpppp me with coddeeeeeee
You need to add MS-Excel file references in you code.
-
Feb 10th, 2012, 04:02 AM
#3
Thread Starter
New Member
Re: Helpppp me with coddeeeeeee
I have added Microsoft.office.Interop.excel as reference..is there anything else than this??
-
Feb 10th, 2012, 06:55 AM
#4
Re: Helpppp me with coddeeeeeee
Moved From The Codebank (which is for sharing code rather than posting questions )
-
Feb 10th, 2012, 07:35 AM
#5
Re: Helpppp me with coddeeeeeee
The only thing that comes to mind is to either Import the namespace... or use the fully qualified names ... here's the problem, the items marked in errors are constants or enums... they need to be defined before you can use them. they are defined in the Excel object model. I'm guessing by the look of the code, that it was actually designed to be run from an Excel macro within Excel... in which case all of those items would have been defined and in scope. You don't appear to be using them in Excel, so you need to get them defined (by adding the reference) and bring them in scope (by importing the namespace).
-tg
-
Feb 10th, 2012, 02:53 PM
#6
Addicted Member
Re: Helpppp me with coddeeeeeee
like techgnome said import the namespace
vb Code:
Imports Excel = Microsoft.Office.Interop.Excel
and also activate the worksheet before pasting.
vb Code:
Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet . . . xlWorkSheet = xlWorkBook.Sheets("Sheet1") xlWorkSheet.Activate()
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
|