Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Workbooks.OpenText in Excel
#1
Can you show me an example how to use Workbooks.OpenText with QM?
#2
Macro
Code:
Copy      Help
Excel.Application ap._create
ap.Visible=-1
act "Excel"
str s.expandpath("$documents$\txt.txt")
ap.Workbooks.OpenText(s @ @ @ 1)
#3
Thanks.

The problem is how include FieldInfo.

In excel:

Sub Macro1()
'
' Macro1 Macro
'

ChDir "C:\"
Workbooks.OpenText Filename:= _
"C:\TXT.TXT", Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 2), _
Array(3, 4))
Application.Run "checkname"
End Sub
#4
Macro
Code:
Copy      Help
typelib Excel
Excel.Application ap._create
ap.Visible=-1
act "Excel"
str s.expandpath("$documents$\txt.txt")
ap.Workbooks.OpenText(s @ @ xlDelimited xlDoubleQuote 0 -1 0 0 0 0 @ VbsEval("Array(Array(1, 1), Array(2, 2), Array(3, 4))"))
#5
Now, it works!

Thanks for all.


Forum Jump:


Users browsing this thread: 1 Guest(s)