Re: Macro control of Gnumeric?



Hello All:

This was my response to Alan Horkan. Originally I included a lot of the macro code and made the message too big. Here it is with reduced macro.

Thanks,

Jim

At 03:41 PM 3/22/2005, Alan Horkan wrote:
Glad gnumeric works well for you (but if you have any problems please do help out by filing bug reports in bugzilla

Will do. I reported the one bug that Morten already fixed that had to do with naming of cells.

I also usualy try using Google site:mail.gnome.org rather than using the built in search provided by the mailing list archives.

Interesting, I'll try that in the future. Thanks.

If you make the effort of finding out this for yourself (and we appreaciate users who do) be sure to include a link/reference so we can
refresh our memories and not repeat what has already been said.

Funny, I almost did that and then for some reason elected not to. Will do so in the future. Here the link to the thread that I found:
http://mail.gnome.org/archives/gnumeric-list/2001-July/msg00089.html

You dont give yourself enough credit, that sounds like programming to me.

Perhaps I am still traumatized by my experience in a FORTRAN class in 1980 8-(

If you can tell us what kind of problems you are trying to solve (as well as the specific functionality you want in a script to try and help
you solve that problem) we might be able to recommend existing scripts or possibly even improve how Gnumeric behaves.

Basically what I do is use one large spreadsheet to do calculations on raw data contained in other spreadsheets. So, my macros just open other spreadsheets, copy specified ranges of data, paste them into the big calculation spreadsheet. I need to sort one range of data in that big spreadsheet (Sorting a range is MUCH faster than using sumif). Finally I copy a range of data from the calculation spreadsheet and paste it onto a new sheet and save that sheet as a specified name. That process is repeated several times.

If you can explain what the macros you had were for there might be people willing to help out providing alternatives.  If they are very simple and you can show us the BASIC source code of the script maybe someone will be interested in trying to rewrite them in python.  I dont want to get your hopes up but there isn't much harm is explaining the problems and seeing if people have ideas on how we might be able to solve them.

Oakey doakey. Below you will see a portion of the code for one of the macros I use. I don't know how much sense it make out of context but I'll be happy to answer any questions you have or provide additional information. The spreadsheet this macro runs is about 23megs in its excel form but only 1.7 megs as a .gnumeric file. So I can email the .gnumeric or upload the .xls if you have a place I can put it.

Thanks for the detailed response and interest!

Cheers,

Jim

Sub biomechanics()
'
' biomechanics Macro
' Macro recorded 10/23/2004 by James C. Martin
'   
    Application.DisplayAlerts = False
   
    Workbooks.Open Filename:="C:\Force Pedal\Parameters_JMC.xls"
    Range("A1:A11").Select
    Selection.Copy
    Windows("CyclingBiomechanics Rev10 Sort.xls").Activate
    Sheets("Parameters").Select
    Range("B1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Windows("Parameters_JMC.xls").Activate
    ActiveWindow.Close
       
   
    Workbooks.OpenText Filename:= _
        "C:\Force Pedal\PedalData\JMC_Fped_Seated_120_250.txt", Origin:=xlWindows, _
        StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
        ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
        , Space:=False, Other:=False, FieldInfo:=Array(1, 1)
    Columns("A:E").Select
    Selection.Copy
    Windows("CyclingBiomechanics Rev10 Sort.xls").Activate
    Sheets("Pedal Data").Select
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Windows("JMC_Fped_Seated_120_250.txt").Activate
    ActiveWindow.Close
    Workbooks.Open Filename:="C:\Force Pedal\MoCap\JMC_mocap_seated_120_250.xls"
    Columns("L:P").Select
    Selection.Copy
    Windows("CyclingBiomechanics Rev10 Sort.xls").Activate
    Sheets("MoCap Resampling").Select
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Windows("JMC_mocap_seated_120_250.xls").Activate
    ActiveWindow.Close
    Application.Run "'CyclingBiomechanics Rev10 Sort.xls'!Sort"
    Sheets("Summary sheet").Select
    Cells.Select
    Selection.Copy
    Workbooks.Add
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Application.CutCopyMode = False
    ChDir "C:\Force Pedal"
    ActiveWorkbook.SaveAs Filename:="C:\Force Pedal\JMC_Seated_120_250_Summary.xls", _
        FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
        ReadOnlyRecommended:=False, CreateBackup:=False
    ActiveWindow.Close
    Windows("CyclingBiomechanics Rev10 Sort.xls").Activate
    Sheets("Pedal Data").Select
   
     
End Sub



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]