How would I go about "loading" an existing Excel spreadsheet in to my VBA form...
I've figured out how to copy cells to an Excel control form...but I want to show all the cell formatting, column width and colors of the original Excel file.
I want to give my users the ability to view, manipulate and save the Excel data from within a VBA form.
Thanks! (code follows...)
Private Sub CommandButton29_Click()
Dim excelapp As excel.Application
Dim wbkObj As Workbook
Dim shtObj As Worksheet
On Error Resume Next
Err.Clear
Set excelapp = GetObject(, "Excel.Application")
Set shtObj = excelapp.Worksheets(1)
ivai% = 1
rvai& = 1.5
sval$ = "text"
shtObj.Cells(1, 1) = ivaf%
shtObj.Cells(2, 1) = rval&
shtObj.Cells(3, 1) = sval$
MainEditor2.Show
Debug.Print (CurrentRowNumber)
Spreadsheet1.Rows(CurrentRowNumber).Insert
Spreadsheet1.Cells(CurrentRowNumber, 1) = Mid(MainEditor0.tbKeyNoteNumber.Text, 1, 2)
Spreadsheet1.Cells(CurrentRowNumber, 2) = MainEditor0.tbKeyNoteNumber.Text
Spreadsheet1.Cells(CurrentRowNumber, 4) = MainEditor0.tbCategoryName.Text
Spreadsheet1.Cells(CurrentRowNumber, 5) = MainEditor0.tbKeyNoteLabel.Text
Spreadsheet1.Cells(CurrentRowNumber, 3) = MainEditor0.tbCurrentNote.Text
End Sub
I've figured out how to copy cells to an Excel control form...but I want to show all the cell formatting, column width and colors of the original Excel file.
I want to give my users the ability to view, manipulate and save the Excel data from within a VBA form.
Thanks! (code follows...)
Private Sub CommandButton29_Click()
Dim excelapp As excel.Application
Dim wbkObj As Workbook
Dim shtObj As Worksheet
On Error Resume Next
Err.Clear
Set excelapp = GetObject(, "Excel.Application")
Set shtObj = excelapp.Worksheets(1)
ivai% = 1
rvai& = 1.5
sval$ = "text"
shtObj.Cells(1, 1) = ivaf%
shtObj.Cells(2, 1) = rval&
shtObj.Cells(3, 1) = sval$
MainEditor2.Show
Debug.Print (CurrentRowNumber)
Spreadsheet1.Rows(CurrentRowNumber).Insert
Spreadsheet1.Cells(CurrentRowNumber, 1) = Mid(MainEditor0.tbKeyNoteNumber.Text, 1, 2)
Spreadsheet1.Cells(CurrentRowNumber, 2) = MainEditor0.tbKeyNoteNumber.Text
Spreadsheet1.Cells(CurrentRowNumber, 4) = MainEditor0.tbCategoryName.Text
Spreadsheet1.Cells(CurrentRowNumber, 5) = MainEditor0.tbKeyNoteLabel.Text
Spreadsheet1.Cells(CurrentRowNumber, 3) = MainEditor0.tbCurrentNote.Text
End Sub