ms-accessactivexobjectxml-spreadsheet

ActiveX Spreadsheet MS access


I would like to ask your help please.

I'm trying to build a form where user will have the option to paste data on the form spreadsheet, after I want to recover that data by VBA to insert it on table.

how can I use that Active X spreadsheet ?? how can I know what value are on cell A1 for example ????

please help me.


Solution

  • Set mySht = Me.Spreadsheet
    

    With mySht With .ActiveWindow.ActiveSheet lastColumn = .UsedRange.Columns(mySht.ActiveWindow.ActiveSheet.UsedRange.Columns.Count).Column lastrow = .Range("A" & mySht.ActiveWindow.ActiveSheet.Rows.Count).End(xlUp).Row End With End With

    MsgBox "Table dimention, Lines = " & lastrow & " columns = " & lastColumn

    ReDim linea(lastColumn)

    For i = 1 To lastrow For j = 1 To lastColumn

        mySht.Cells(i, j) 'something with the cell (i, j)
    Next ' end line
    

    Next ' next Line ' dispose Set mySht = Nothing