Help importing Excel file

ellenr

Registered User.
Local time
Today, 11:17
Joined
Apr 15, 2011
Messages
400
Problem: Excel file sent to me containing golf indices, which come in with max 1 decimal digit (example 15.2). I import file into Access 365 db as a new table with vba code:
Code:
Dim vFilePaths As Variant
    
    vFilePaths = fGetFile(e_MultiSelect + e_FileMustExist + e_Explorer, , , , , , _
                          "Choose file to Import", , 4096)
    
    If Len(vFilePaths) > 0 Then
                strImage = CStr(vFilePaths)
    End If
DoCmd.TransferSpreadsheet acImport, 10, "GHINIndexList", strImage, True, "A:B" 'first two cols

If I select the 15.2 in the Excel file, the actual value is 15.19999etc. but it imports as 15.1 and not 15.2. I obviously need it to round up, but it is already truncated after the above code. What am I missing? I know I could round the index value if it imported with all of the decimal digits, but it just truncates without giving me the option.
 

Attachments

Last edited:
When I open the xls, no sheet shows. Second time in a week this has happened. I had to copy/paste from Explorer preview to a new workbook.

I imported and values are not truncated. But I am use Access 2010.
 
When I tried I get 'Search key is not found in any record' :confused:

If I link to it, I get all the decimal places.
 
Please never mind. I think one of my users decided to change the values. Please don't spend any more time trying to help me until I am sure I need your help! Frustration!!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom