All pastes from other apps altered after macro - not what I wanted

J

Jim

I've written a macro that opens a txt file as space
delimited, copies it into an xls workbook, and then moves
the data from the txt sheet to an xls sheet. However,
after I run the macro and then do my other work, all
pastes into Excel from other apps (Impromptu, Arthur) are
mis-formatted. It's space delimiting all pastes. Can
anyone suggest what I've done to cause this and what
would fix it?
 
G

Guest

Follow-up:
I stepped through the code to find exactly at what step
the unwanted behavior was started, which is after
the .txt file is opened. The code is:
fileToOpen = Application.GetOpenFilename("Text Files
(*.txt), *.txt")
' Path to export template file - will need to be
changed if location ever changes
Workbooks.Open Filename:= _
"K:\Department Files\CM Corporate
Marketing\Selections\Macro work for selection
export\Template for finished file.xls"
Workbooks.OpenText Filename:=fileToOpen _
, Origin:=xlWindows, StartRow:=1,
DataType:=xlDelimited, TextQualifier _
:=xlDoubleQuote, ConsecutiveDelimiter:=True,
Tab:=False, Semicolon:= _
False, Comma:=False, Space:=True, Other:=False,
FieldInfo:=Array(Array( _
1, 1), Array(2, 1), Array(3, 1), Array(4, 1),
Array(5, 1), Array(6, 1), Array(7, 1), Array(8, _
1), Array(9, 1), Array(10, 1))

What in the OpenText method sets the default paste format
for the entire application?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top