i have a question regarding excell and i have read about si_the_geeks tutorial about excell:
1. how can you make excell.book as a read only file? (with password)
2. how can you make it as an autoformat? i have made some error and made my computer crash several times... thats why i needed your help...![]()
Code:Private Sub CmdPrint_Click() Dim iRow As Long Dim iCol As Long Dim xls As Excel.Application Dim newcell As String Set xls = New Excel.Application xls.Workbooks.Open (App.Path & "\book1") DoEvents xls.Visible = True For iRow = 0 To MSFlexGrid1.Rows - 1 For iCol = 0 To MSFlexGrid1.Cols - 1 MSFlexGrid1.Col = iCol MSFlexGrid1.Row = iRow newcell = Chr(iCol + 65) & iRow + 1 xls.Worksheets("sheet1").Range(newcell).Value = MSFlexGrid1.Text Next Next End Sub




Reply With Quote