I am doing one project in which Whenever I export the result, the list of record should be extracted as Excel file and the list of record should be listed within Excel Table with formated Line.

So, I want to format Excel from VB so as to make line / Table, If any one know hoe to make line or Table in Excel by using VB6, tell me please.

you need to use excel library for the purpose.

Oh Debasi,

I always expect you to answer my question, but your answer too vaque, I just find the answer tonight from some site, and I am trying for this, but line is not funtioning till now, do you know what is wrong with my VB code as below:

Dim obExcelApp As Object
Dim obWorkSheet As Object

obWorkSheet.Range("A3").Select
selection.Borders(xlDiagonalDown).LineStyle = xlAutomatic 'xlNone
selection.Borders(xlDiagonalUp).LineStyle = xlAutomatic 'xlNone

With selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

is that throwing any error or simply not functioning ?

Hi Debasi,

It does not give error, it simply not functioning, that is why I am very confusing. It tried in so many ways for about three night. If you can give me the correction / my fault, I shall be very very glad.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.