+ Reply to Thread
Results 1 to 4 of 4

Macro for output to existing result files

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Macro for output to existing result files

    Hi all,

    I hope you can help me.

    I have a problem in Excel 2007. I am currently running an optimisation program for a fuel cell.

    The optimisation program considers 5 minute electrical demand data for a whole year and has over 105,000 rows of data on the main calculation page - it is very large.

    To produce useful outputs, the program must be run over and over with different input parameters (to help optimise the operation of the FC) - i can handle this programing. However, with the program being so large, I would like to output the results of each program run to a seperate output file (this helps to keep down the size of the initial program file - this presents me with several problems:

    1) How do I select my output columns/range (in the original program) and output to a different output file?

    2) When the outputs arrive in the output files, I need to do a lot of post processing (to produce the required graphs/tables). As such, the output files to which the outputs are written must already exist and contain all necessary post processing formulae and formatting.

    3) When I send the program to the client, won't the output file locations be lost and the output macro rendered useless???

    I am really struggling to think how best to procede- if anyone has any hints/ideas they would be very gratefully received.

    Thanks,

    Sam

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Macro for output to existing result files

    Sam - I suggest you attach a small sample workbook illustrating how your data are laid out and how you would like the output laid out.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro for output to existing result files

    Welcome to the forum!

    One method might be to build an xls with minimal data with the charts and macros already created. The code would copy this "template" file and insert the data. One method that would work well is ADO. You can use SQL to Insert data Into the table without ever opening the copied xls. Of course it is easy enough to Open the copied xls and insert the data from another xls or your personal.xls's code.

  4. #4
    Registered User
    Join Date
    03-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Exclamation Re: Macro for output to existing result files

    Thanks Stephen and Kenneth - i am very grateful for your help,

    Unfortuantely Kenneth I don't understand some of the technical terms you have used or how to implement what you have suggested!

    I have attached some toy files which hopefully illustrate

    1) The layout of the data i am producing ("Optimisation program outputs")
    2) The layout of the output files that needs to be produced - i have included an example of some basic post processing which will need to be done ("Output file template")

    I have also attached a schematic diagram which may help to illustrate my problem more clearly.

    Thanks,

    Sam Gregson
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1