Results 1 to 9 of 9
  1. #1
    robx2309 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    8

    With my unbound object frame control (reference to Excel spreadsheet)

    Hi all,


    My problem is that I have an unbound object frame and I'd like to know how to do to hide the horizontal scrollbar, and the row and column headings.

    And I also would like to know how can I do to retrieve the datas (having it in a variable within my form) I have pulled in my spreadsheet, because I would like, afterwards, insert them in my database.

    Any help would be greatly appreciated

    Have a nice day !

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What version of Access? I tested this in 2010 and have opposite issue. No scroll bars and don't see any way to get them. Doubt column headings can be hidden.

    You can import spreadsheet data to Access table or link to a spreadsheet with the External Data utility.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    robx2309 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    8
    I use Access 2003.
    But do you know if there is a way to retrieve the datas entered in the spreadsheet by coding ?
    For example a function that is defined in the spreadsheet's code and that can be used in the Access form's code to return the value of a cell (for a given row and column) ?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not understanding what you mean by "function that is defined in the spreadsheet's code and that can be used in the Access form's code" But, yes, you can connect to an Excel workbook and get data from cells. Check this http://www.xtremevbtalk.com/showthre...621#post969621

    Here is simple example:
    Code:
    Private Sub GetExcelData()
    Dim oExcel As Excel.Application
    Dim oBook As Excel.Workbook
    Dim rowRW As Integer
    Dim strFAAID As String
    Set oExcel = CreateObject("Excel.Application")
    Set oBook = oExcel.Workbooks.Open("\\servername\path\filename.xlsx")
    rowRW = 2
    With oBook.Worksheets("Taxiway_Apron")
        Do While Not IsEmpty(.Range("A" & rowRW))
            If .Range("D" & rowRW) = "Airport" Then
                strFAAID = strFAAID & .Range("A" & rowRW) & vbCrLf
                End If
            End If
            rowRW = rowRW + 1
        Loop
    End With
    MsgBox strFAAID
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    robx2309 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    8
    Thanks for the code, that's what I was looking for.

    Just a last question, as my excel file is not explicitly on my hard drive (it is within my form), what do I have to write to remplace this line :
    Code:
    Set oBook = oExcel.Workbooks.Open("\\servername\path\filename.xlsx")

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have no idea how to refer to spreadsheet embedded on form, never done that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    robx2309 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    8
    Right, I will try to figure this outon my own.
    And which solution would you advise me : using ADO to connect to my spreadsheet or use the code you wrote in your previous message ?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What I posted is all that I am familiar with, only method I have used.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    robx2309 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    8
    Right,
    I will try to figure out how to link it to my form. Thanks a lot fo your help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 04-22-2011, 04:58 AM
  2. Invalid database object reference.
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 04-11-2011, 02:48 PM
  3. Bound Object Frame Combo sorted Results
    By kevsim in forum Programming
    Replies: 7
    Last Post: 01-08-2011, 06:30 PM
  4. Replies: 2
    Last Post: 10-18-2010, 07:53 AM
  5. Replies: 1
    Last Post: 08-05-2010, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums