Need to convert some VB to perl

Discussion in 'Perl Misc' started by paul.porcelli@scottishwater.co.uk, Aug 3, 2005.

  1. Guest

    Hi there,
    I need to convert the code below to perl.
    I have had may attempts but am still not there.

    Any advice/help will be much appreciated.
    Thanks.
    Paul

    With
    ActiveSheet.QueryTables.Add(Connection:="TEXT;H:\Projects\Performance
    Improvement\acc_res.030805", Destination:=Range("A1"))
    .Name = "acc_res.030805"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .TextFilePromptOnRefresh = False
    .TextFilePlatform = 850
    .TextFileStartRow = 1
    .TextFileParseType = xlDelimited
    .TextFileTextQualifier = xlTextQualifierDoubleQuote
    .TextFileConsecutiveDelimiter = True
    .TextFileTabDelimiter = True
    .TextFileSemicolonDelimiter = False
    .TextFileCommaDelimiter = False
    .TextFileSpaceDelimiter = True
    .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
    .TextFileTrailingMinusNumbers = True
    .Refresh BackgroundQuery:=False
    End With
    Columns("A:A").ColumnWidth = 16.86
     
    , Aug 3, 2005
    #1
    1. Advertising

  2. wrote:
    > Hi there,
    > I need to convert the code below to perl.
    > I have had may attempts but am still not there.
    >
    > Any advice/help will be much appreciated.


    <snip>

    What have you tried so far?

    >
    > With
    > ActiveSheet.QueryTables.Add(Connection:="TEXT;H:\Projects\Performance
    > Improvement\acc_res.030805", Destination:=Range("A1"))
    > .Name = "acc_res.030805"
    > .FieldNames = True
    > .RowNumbers = False
    > .FillAdjacentFormulas = False
    > .PreserveFormatting = True
    > .RefreshOnFileOpen = False
    > .RefreshStyle = xlInsertDeleteCells
    > .SavePassword = False
    > .SaveData = True
    > .AdjustColumnWidth = True
    > .RefreshPeriod = 0
    > .TextFilePromptOnRefresh = False
    > .TextFilePlatform = 850
    > .TextFileStartRow = 1
    > .TextFileParseType = xlDelimited
    > .TextFileTextQualifier = xlTextQualifierDoubleQuote
    > .TextFileConsecutiveDelimiter = True
    > .TextFileTabDelimiter = True
    > .TextFileSemicolonDelimiter = False
    > .TextFileCommaDelimiter = False
    > .TextFileSpaceDelimiter = True
    > .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
    > .TextFileTrailingMinusNumbers = True
    > .Refresh BackgroundQuery:=False
    > End With
    > Columns("A:A").ColumnWidth = 16.86
    >


    At first glance:

    check out Win32::OLE for driving eg Excel

    but it really depends on what your requirements are. If you just want to
    retrieve the data and manipulate it with Perl then there are other ways
    of doing it eg LWP and HTML::TableExtract.

    What exactly is it you want to do?

    Mark
     
    Mark Clements, Aug 3, 2005
    #2
    1. Advertising

  3. kdp Guest

    >From the looks of your snippet, you are looking to grab all the
    valid data in column A1 of an Excel spreadsheet. This can
    certainly be done in Perl, but the question must be asked: how
    familiar are you with the Perl language?

    -keith
     
    kdp, Aug 4, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    692
    Guest
    Feb 25, 2004
  2. Andreas Klemt
    Replies:
    1
    Views:
    405
    Karl Seguin
    Jul 23, 2003
  3. Holmes!
    Replies:
    2
    Views:
    448
    Malcolm Dew-Jones
    Apr 2, 2005
  4. Domino
    Replies:
    5
    Views:
    403
    dorayme
    Nov 5, 2006
  5. CGmancp32
    Replies:
    0
    Views:
    1,152
    CGmancp32
    Dec 27, 2008
Loading...

Share This Page