Excel in VB.Net

ripon

Member
Joined
Mar 23, 2006
Messages
15
Programming Experience
Beginner
Hi There:
How can I change these VBA(Excel) code in VB.net.

(a)
xrange.Borders(xlDiagonalDown).LineStyle = xlNone
xrange.Borders(xlDiagonalUp).LineStyle = xlNone

(b)With xrange.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
I was trying this. Am I Ok:
Am I right
With xRange.Borders(Excel.XlBordersIndex.xlEdgeLeft)
.LineStyle = Excel.XlLineStyle.xlContinuous
.Weight = Excel.XlBorderWeight.xlMedium
.ColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic
EndWith

(c)With xlSheet.PageSetup
.FirstPageNumber = xlAutomatic
.PrintComments = xlPrintNoComments
---Am I ok for this--.PrintComments = Excel.XlPrintLocation.xlPrintNoComments
.RightMargin = Application.InchesToPoints(0.196850393700787)
.TopMargin = Application.InchesToPoints(0.78740157480315)
End with

Pls help me. I tried so many times but failed.
Thanks in advance.
 
I'm not sure what's wrong with the code, but I'll give you some tips that may help others anwer your question.
Instead of saying "I tried so many times but failed" tell us what happened when you failed, did you get an error message and if so what is that error message.
What is xRange (show your declarations).
 
Back
Top