0

What i want to do is to select a Range using TableName & ColumnName

the Working Code in VB.net is

Dim xlApp As Interop.Excel.Application = GetObject(workbookName).Application
xlApp.Range(tableName & "[ColumnName]")._Default(i + 1).Value = 3

How Can i do just the Same in C# ??? i tried something like that but no luck :(

var xlApp = new Excel.Application();
xlApp.Range[tableName + "[ColumnName]"][i+1].Value = 3

1 Answer 1

1
Interop.Excel.Application xlApp = 
     Interaction.GetObject(workbookName).Application;
xlApp.Range(tableName + "[ColumnName]")._Default(i + 1).Value = 3;

Try this

Sign up to request clarification or add additional context in comments.

1 Comment

i tried your way: Interop.Excel.Application xlApp = Interaction.GetObject(workbookName).Application; .Application is marked red in IntelliSense !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.