Need to convert some VB to perl

P

paul.porcelli

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
 
M

Mark Clements

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
 
K

kdp

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
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top