|With VB2008 I am able to create a new Excel sheet as the following:
Dim conn2 As New OleDbConnection()
conn2.ConnectionString = m_sExcelConnection
Dim cmd As New OleDbCommand()
cmd.Connection = conn2
cmd.CommandText = "CREATE TABLE Detail (Invoice_No char(255),CheckIn char(255),CheckOut char(255),"
cmd.CommandText += "RNum integer,Guest_Name char(255),Base_Room_Charge Decimal,Service_Charge Decimal,"
cmd.CommandText += "HEBERGEMENT Decimal,TPS Decimal,TVQ Decimal,Total_Taxes Decimal,Total_Charges Decimal,"
cmd.CommandText += "Total_Deposit Decimal)"
Catch ex As Exception
- However, after I INSERT data into their columns then try to sorting each column, the Header also being sorting
- But if I hight-light the Header row and right-click on it then selecting Cell Format --> Protection --> Mask ... then I can sort every column without touching the Headers
*) Since the user probably doesn't know how to do like me, I would like to program it automatically with VB ... any one can help?