View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Rinze Rinze is offline
external usenet poster
 
Posts: 1
Default running macro step by step different from normal run??

Hi KeepITcool,

I've been out for a while, but back working on this problem now.
We're trying to esteblish it working on Excel97, so I can't use the
'Local' parameter.
I do understand your statement about me opening the document twice.
I've deleted that first line.
However, it still seems very strange to me that there is a difference
in the data of the imported file when it's imported (macro executed) by
toolbarclik or by 'play-button' in the VBA-editor.
Can you (or anyone else) explain to me why this happens?

Rinze Smit
Revalidatie Friesland.

keepITcool wrote:
your code opens the file
then reopens the same file via opentext method.

the first line can be removed.

re "localized"
open one of the txt files with notepad.

If numbers are stored with . as decimal separator
and dates appear in mmddyy then USenglish format is used.
open with
Opentext(..... Local:=false)

If numbers are stored with , as decimal and ddmmyy dates
then use
Opentext(....... Local:=True)

Local parameter is ONLY valid if you have Excel XP or newer!!
will generate error on older versions.

Else mail me 1 of the txt files and the workbook with the code.
and I'll have a look.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Rinze Smit wrote :

Set myBook = Workbooks.Open(pathToUse & myFile)
Workbooks.OpenText Filename:=pathToUse & myFile, Origin:=xlMSDOS _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0,
1), Array( _
6, 1), Array(37, 1), Array(47, 1))