Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel object and QueryTables Method
Message
From
30/01/2002 11:44:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00612699
Message ID:
00612829
Views:
19
>Does anyone have experience using an Excel object from a Visual Foxpro program using the QueryTables method? I am trying to populate 1 worksheet in a workbook containing 4 worksheet from a txt file.
>
>I appreciate any help!!
>
>Thanks!
with oExcel.ActiveWorkBook.ActiveSheet
 .QueryTables.Add('TEXT;'+sys(5)+curdir()+'mytext.txt',.Range('A1'))
endwith
  use myTable
  Copy to (lcFileName) type delimited with TAB
  With oExcel.ActiveWorkbook.ActiveSheet
      With .QueryTables.Add("TEXT;"+lcFileName, .Range("A1"))
        .Name = "Page "+ltrim(str(1))
        .BackgroundQuery = .T.
        .AdjustColumnWidth = .T.
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileTabDelimiter = .T.
        .Refresh(.F.)
      Endwith
  Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform