LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Importing external data

I'm at wits end. I've tried to be a little lazy and I've used the macro recorder to write some code for me to import external data
from a tab-delimited text file. My first problem is that I just want to import the data. I don't want to save the query and I go
into the properties when I'm doing the import and I uncheck that box. However, after it imports the query, when I later delete the
data, it tells me there is a query saved with that data and I'll be deleting it if I check "Yes". This is about to make me scream.
Please tell me how I can import the data without this problem.

Secondly, still on the issue of the macro recorder writing code. I am importing data from 4 sources onto 4 worksheets independently
of each other. Two of the imports are from other Excel files. The code it creates for those imports is REALLY driving me up the
wall. Below is the 1st couple of lines of code:

With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password=" """;User ID=Admin;Data Source=C:\Documents and
Settings\Administrator\Desktop\KoreAug.x" _
, _
"ls;Mode=Share Deny Write;Extended Properties=""HDR=YES;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet
OLEDB:Databa" _

Notice that it cuts off the file extension, xls, right at the "x"! I don't get it. Making matters worse, it then puts ", _" on the
next line, and begins the next line with "ls;".

If I try to fix this stupid code and eliminate the comma and the split, and just put the whole name on the same line, I either get
errors when I run it the code (type mismatch?) or the whole code turns red on me for syntax problems. Does anybody have any idea
what in the wild world of sports is going on here? Finally, is there some boilerplate code I could use for just importing some basic
data from a table in an external xls file without all of this BS?

Thank you very much in advance !
--
RMC,CPA



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing External Data Donbenz1 Excel Discussion (Misc queries) 0 June 14th 07 09:36 PM
Importing External Data Hari[_2_] Excel Discussion (Misc queries) 0 March 22nd 07 12:22 PM
Importing External Data Hari[_2_] Excel Discussion (Misc queries) 0 March 22nd 07 11:11 AM
Importing External Data Paul Hammond Excel Discussion (Misc queries) 0 December 15th 05 10:28 PM
Importing external data TexasLakeRat Excel Programming 1 February 15th 05 02:37 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"