Hello everyone… Happy Friday!!
I’m hoping for some help from the experts again…
Is there code that I can run from inside an open Access 97 database, that would import a text file into Excel, save it as an .xls … and then import the Excel file into an Access table?
I know this sounds crazy… but as I was telling you in my post last week, I’ve been coming across some seriously strange anomolies lately… and I’m trying to develop a workaround…
Here’s the situation… I developed an application for the department well over a year ago… It’s been working fine until recently… Part of the process involved is importing a delimited text file from one of the network drives every day… All of a sudden, when it tries to import this text file, Access either hangs completely or comes up with an error about the Record Length being too long…. (I immediately thought that it wasn’t recognizing the delimiters… but the reallllyyyy strange part is that if the same database…. exactly the same… is run from a computer on another floor… it works perfectly!!… So for a while now (I didn’t know this… lol), the person upstairs has been taking the time to run the process and email a new text file to the guy who runs it down here…. The person in my department who gets this text file then saves it to his C:Temp folder, and runs the process with that path…. and it works…. ???? Sound a little crazy to you??? LOL
I’ve tried just about everything I can think of… I’ve tried importing it into a blank database…. I’ve tried it at different computers in this department (’cause I’m still missing the service packs for ’97 on mine)… and nothing is different… If I try to import the original text file placed on the network drive… and/or if I try placing the original text file on another shared drive and import from there… Access hangs completely… or gives that error… (depending on its mood…) …there’s no identifiable pattern… LOL…
Then I had a thought… Maybe I can import it into Excel???…. That worked perfectly!!!?? … Go figure????
Now… if someone knows why the problem is occuring to begin with.. wonderful… I’d love to hear it!…. But as of right now… I’m trying to finish this workaround…. I can make it work manually… It imports correctly into Access from the Excel file… However, the manager would prefer that the user not have to manually import the text file to Excel and then import into Access….
I’ve never used VBA to access different Office applications in the same process…. Right now I have a macro that runs my code and some queries… Can I incorporate some code to do the import into Excel and then import into Access?… Is this possible?
Hope that’s not a dumb question…. Thanks in advance for any ideas you have…
Trudi