Murray Brown
asked on
VSTO Excel Add-In problem reading Excel cells
Hi
If I create a fresh Excel 2007 Add-In project in Visual Studio 2010 and create a Windows form,
what is the simplest way to read cell values from the Active Excel workbook?
Do I need to add any references or imports?
If I create a fresh Excel 2007 Add-In project in Visual Studio 2010 and create a Windows form,
what is the simplest way to read cell values from the Active Excel workbook?
Do I need to add any references or imports?
ASKER
I get the error 'Activeworkbook' is not declared. It may be inaccessible due to its protection level
You may need to open the workbook first
workbooks("yourworkbook.xl sx").open
Workbooks("yourworkbook.xl sx").activ iate
Then I can't see how activeworkbook could give you any problems.
workbooks("yourworkbook.xl
Workbooks("yourworkbook.xl
Then I can't see how activeworkbook could give you any problems.
ASKER
No that is not it.I thought that I had to use Microsoft.Office.Interop.. .. or Globals..... but can't work out the code
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Excellent. Thanks
or
workbooks("Example.xlsx").