By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

.NET Excel parameters

P: n/a
Bob
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

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Bob" <Bo*@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.