Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Posts
    348

    Unanswered: Argument passed null

    I can't figure out what I am doing wrong on this. In the Load event I have:

    Code:
    Dim InboundSpreadsheet As String
    InboundSpreadsheet = GetFileLocation()
    Debug.Print InboundSpreadsheet & " Inboundspreadsheet"
    ImportExcelFile (InboundSpreadsheet)
    My second to last line prints the file path I expect to the immediate window. When I enter the sub ImportExcelFile I get a message that the argument is null.

    Code:
    Sub ImportExcelFile(Location As String)
    Debug.Print Location & " Location"
    DoCmd.TransferSpreadsheet acLink, , , Location
    End Sub
    I go to the debugger and hover over the variable Location and get back "" as the value. I'm sure it is very simple but I can't find it.

  2. #2
    Join Date
    Feb 2007
    Posts
    348
    Scratch that I'm a dummie.
    My debug print statements were not unique enough and I thought the variable was making it out but wasn't. It appears to be due a a next statement I was trying to use.

Posting Permissions

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