.NET Excel parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've set a reference to Excel and Imported Micorosoft.Excel. In the code
snippet below I get a squiggly line under the items starting with "xl". How
do I reference them?

.Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
 
Hello,

You need to place the following at the top of your file:-

Imports Microsoft.Office.Interop.Excel

and your line of code would become:-

..Selection.Sort Key1:=Range("C2"), Order1:=XlSortOrder.xlAscending,
Header:=XlYesNoGuess.xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=Constants.xlTopToBottom

Hope this helps,
Simon Jefferies
simon(nospam)@cooltoolsonline.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top