Hi everyone,
I have a bound object frame on my form which has contains an excel object (class = Excel.Sheet.8). When the user wants to create a new excel file, I have button such as:
Code:
Private Sub CreateNew_Click()
On Error Resume Next
If IsNull(Excel) Then
Excel.Action = acOLECreateEmbed
Excel.Action = acOLEActivate
Else
If MsgBox("It seems you already have data, would you still like to create a clean sheet?", vbYesNo, "Warning") = vbYes Then
Excel.Action = acOLECreateEmbed
Excel.Action = acOLEActivate
End If
End If
End Sub
Now my question is, how do I access the cells in the embedded Excel file? Like for example, I want to get the data like how I do this in excel: Worksheets(1).Cells(1,1)
I looked at some other posts on how to do this. But if I dim a variable like: Dim a as Excel.Worksheet, Access gives me an error saying "User defined type not defined".
Thanks ahead for the help guys! (I'm still kind of a noob with vba. Is there a good tutorial on learning about Objects and their manipulation?)