Consulting

Results 1 to 6 of 6

Thread: access to excel docmd.transferspreadsheet

  1. #1

    access to excel docmd.transferspreadsheet

     Set db = CurrentDb()
             db.QueryDefs("strSoftwareNameOI").SQL = "SELECT Software.[Software Name], Software.Version, Software.[Operating System], " & _
                "Software.Status, Software.[Status Date], Software.[Approved Platforms], " & _
                "Software.[Code Type], CUsage.[Cost Center], CUsage.[Entered On] " & _
                "FROM Software INNER JOIN CUsage " & _
                "ON Software.[Software Name] = CUsage.[Software Name] " & _
                "AND Software.Version = CUsage.Version " & _
                "AND Software.[Operating System] = CUsage.[Operating System] " & _
                "WHERE Software.[Software Name] = '" & strSoftwareNameOI & "' " & _
                "AND Software.Version = '" & strVersionOI & "' " & _
                "AND Software.[Operating System] = '" & strOSOI & "' "
     
     
    DoCmd.TransferSpreadsheet acExport, , "strSoftwareNameOI", "C:\Documents and Settings\mjw\Desktop\testing.xls", True

    The transferspreadsheet doesnt work, does anyone know a reason as to why it will not work?

    Thanks!

  2. #2
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    What error number and message are you getting?
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  3. #3
    no error message, Access just locks up and I get the program is not responding and have to exit out of it and click end now.

    It works if i use docmd.outputto acOutputQuery but I cant use that because I need multiple queries to go into one excel file.

    I dont know whats wrong with it, i've tried everything that I know of

  4. #4
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    I would imagine that the error is caused because the querydef hasn't completed updating by the time your next line of code attemtps to export the data in Excel. I would suggest creating that as an actual query object in your database- that will take away this possibility.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  5. #5
    How would I go about creating it as a query object?

  6. #6
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    just create a new query using the query designer.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •