Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Unanswered: transferspreadsheet, sheetnumber instead of sheetname

    I'm using this code (the entire procedure is not included)

            importnavn = "temp" & Trim(Str(X))
            Sheetnavn = "Sheet" & Trim(Str(X)) & "!"
            boxstring = boxstring & "Ark" & Trim(Str(X)) & ";"
            MsgBox "test: " & Sheetnavn & " test", vbOKOnly
            DoCmd.TransferSpreadsheet acImport, , importnavn, filen, True, Sheetnavn
    to import sheets from excel to access tables. It all works very nice, as long as the sheets are using english sheetnames "sheet1"..."sheetX", but I was wondering if there's a way using the range variable with a sheet number rather than a name, as I don't always know the name of the sheets being imported.


    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    if thats your problem I'd suggest using OLE automation, open an instance of Excel and
    examine the excel collections - one or more of them has the sheet names included - it may be in the workbooks collection


Posting Permissions

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