Moderator: 2020vision
by Steve Voltage » Sun Nov 15, 2009 2:45 pm
by GaryRussell » Sun Nov 15, 2009 3:22 pm
r = SHGetPathFromIDListA(ByVal x, ByVal sPath)
by Steve Voltage » Sun Nov 15, 2009 9:00 pm
GaryRussell wrote:On the declare statement an alias is used, therefore the statement that gives the error should read as follows.
- Code: Select all
r = SHGetPathFromIDListA(ByVal x, ByVal sPath)
by Steve Voltage » Sun Nov 15, 2009 9:13 pm
by osknows » Sun Nov 15, 2009 9:35 pm
by Steve Voltage » Sun Nov 15, 2009 10:13 pm
osknows wrote:Where have you placed the code? It should be in a module and not a worksheet object; a function cannot be of type Public unless it's in a module
The shell32.dll is in Tools/References/Microsoft SHell Controls and automation
by Steve Voltage » Sun Nov 15, 2009 10:22 pm
Arnold wrote:osknows wrote:Where have you placed the code? It should be in a module and not a worksheet object; a function cannot be of type Public unless it's in a module
The shell32.dll is in Tools/References/Microsoft SHell Controls and automation
Where is Tools/References/Microsoft SHell Controls and automation in excel 2007 please m8?
by osknows » Sun Nov 15, 2009 10:33 pm
by Steve Voltage » Sun Nov 15, 2009 10:41 pm
osknows wrote:Your code works fine for me
The code is in a module and I have the following references checked only
Visual Basic for applications
Microsoft Excel 11.0 Object Library
OLE automation
by osknows » Sun Nov 15, 2009 10:42 pm
Sub Data_Extract()
Application.EnableEvents = False
'The following bit sets the dimensions for the data - i.e. defining which data to collect and how.
Dim fs, f, f1, fc, s, FilePath
Dim Datastore(250, 4) As Variant
'This bit finds the directory that the files are stored in.
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show
'This finds the last file in the directory - and then sets the file paths.
For lngCount = 1 To .SelectedItems.Count
EndofPath = InStrRev(.SelectedItems(lngCount), "\")
FilePath = Left(.SelectedItems(lngCount), EndofPath)
Next lngCount
End With
'This sets the variables to find each file.
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(FilePath)
Set fc = f.Files
'This selects the relevant data - and gives it a defined name.
For Each f1 In fc
lrow = ""
lrow2 = ""
excelfile = f1.Name
Workbooks.Open Filename:=FilePath & excelfile ', UpdateLinks:=False
ActiveWorkbook.Worksheets(1).Select
lrow = Cells(Rows.Count, 1).End(xlUp).Row
If lrow >= 2 Then
Rows("2:" & lrow).Select
Selection.Copy
Application.Workbooks("BFSP Extract.xlsm").Activate
Application.Sheets("BFSP Data").Activate
lrow2 = Cells(Rows.Count, 1).End(xlUp).Row + 1
Rows(lrow2).Select
ActiveSheet.Paste
Range("R" & lrow2 & ":" & "R" & (lrow - 2 + lrow2)).Value = excelfile
Range("A1:A200000").Activate
Selection.RowHeight = 12.75
End If
Application.Workbooks(excelfile).Activate
Application.DisplayAlerts = False
ActiveWorkbook.Close savechanges:=False
Application.DisplayAlerts = True
Next
Application.EnableEvents = True
End Sub
by Steve Voltage » Sun Nov 15, 2009 10:50 pm
by osknows » Sun Nov 15, 2009 11:00 pm
by Steve Voltage » Sun Nov 15, 2009 11:03 pm
osknows wrote:Try this file - Run the code in the module, point it at your csv files an see what happens.
This definitely works for me
http://www.mediafire.com/file/nzzr2ziun2d/BFSP Extract.xls
The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.
Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.
Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.
He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.
We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.