Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Different querytable behaviour in Office 2003?

Hi!
I've been using a querytable to import a csv-file into a worksheet
with Office 2k. The text file contains blank lines which need to be
preserved for several reasons.
After upgrading to Office 2003, those blank lines disappear after the
call to qt.Refresh.

Here's the whole macro:

Set qt = wb.Worksheets(1).QueryTables.Add("Text;" + "fred.csv",
[A1])

With qt
.Name = p
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFileThousandsSeparator = "."
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With

Is it that I'm to dumb to find the answer in the VBA Help?

Regards,

Uwe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Different querytable behaviour in Office 2003?

I run Office 2003

I created a dummy CSV file with the a b c d e f on separate lines separated
by a blank line.
That worked ok and the blank lines came through when using the code you
supplied.

What I tried doing is saving my CSV file in Unix format.
This means instead of Windows format which ends a line as CR LF, it ends a
line as just LF
It imported without blank lines.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Uwe M?ller" wrote in message
om...
Hi!
I've been using a querytable to import a csv-file into a worksheet
with Office 2k. The text file contains blank lines which need to be
preserved for several reasons.
After upgrading to Office 2003, those blank lines disappear after the
call to qt.Refresh.

Here's the whole macro:

Set qt = wb.Worksheets(1).QueryTables.Add("Text;" + "fred.csv",
[A1])

With qt
.Name = p
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFileThousandsSeparator = "."
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With

Is it that I'm to dumb to find the answer in the VBA Help?

Regards,

Uwe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Different querytable behaviour in Office 2003?

"Rob van Gelder" wrote in message ...
I run Office 2003

I created a dummy CSV file with the a b c d e f on separate lines separated
by a blank line.
That worked ok and the blank lines came through when using the code you
supplied.

What I tried doing is saving my CSV file in Unix format.
This means instead of Windows format which ends a line as CR LF, it ends a
line as just LF
It imported without blank lines.


My CSF files are created on a Linux machine and therefor by default
only have LF line endings. After I modified the script to terminate
lines with CR LF, everything went fine.
Thanks for the really great help, Rob!

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Uwe M?ller" wrote in message
om...
Hi!
I've been using a querytable to import a csv-file into a worksheet
with Office 2k. The text file contains blank lines which need to be
preserved for several reasons.
After upgrading to Office 2003, those blank lines disappear after the
call to qt.Refresh.

Here's the whole macro:

Set qt = wb.Worksheets(1).QueryTables.Add("Text;" + "fred.csv",
[A1])

With qt
.Name = p
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFileThousandsSeparator = "."
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With

Is it that I'm to dumb to find the answer in the VBA Help?

Regards,

Uwe

Reply
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
Very annoying behaviour of Excel 2003 Jean Excel Discussion (Misc queries) 3 February 15th 10 10:08 PM
strange behaviour in Excel 2003 when importing XML Marius Bancila Excel Discussion (Misc queries) 1 October 23rd 06 08:53 AM
Upgrading from Office 2003 Small Bus to Office 2003 Pro Kelly Setting up and Configuration of Excel 0 September 25th 06 06:07 PM
Office 2000/Office 2003 Excel not printing landscape vise versa BAHTTEXT in English text Setting up and Configuration of Excel 1 April 17th 06 01:37 PM
Problem sharing spreadsheet between Office10 (Office XP) and Office 11 (Office 2003) Sage Solutions Group Excel Programming 0 August 20th 04 08:58 PM


All times are GMT +1. The time now is 12:05 AM.

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

About Us

"It's about Microsoft Excel"