Posts by FWind

    Good point, but I don't really want to give up the idea yet. In the new version I use an API-call to automagically find the temp path name and create a random file name. I then delete the file when I'm done with it. This way it would be safe for all (most?!?) users, regardless of setup.


    /Fredrik

    Hi everybody.


    A small warning when posting files in a forum - Excel has built-in document properties that displays name, company, department and other things.
    It is probably best to remove this data (File | Properties) before posting, otherwise your displaying more info about yourself than your are comfortable with.



    When everybody is out to get you, paranoia is just good thinking.


    /Fredrik

    Hi


    The trick is to use the Export method of the chart object to save the chart as a GIF file and then import it in an Image control.


    I've created a small example of this, it is a userform with a Image control.
    When the form is activated the chart is scaled to fit the image size, saved as a temporary GIF file and finally imported to the image control.


    HTH
    /Fredrik

    Hi


    I strongly recommend you to use a database to handle this amount of data.


    I've created a small workbook which calculates the average of multiple sheets using the SUMIF and COUNTIF worksheet functions.


    HTH
    /Fredrik

    Hi


    Now this proposal will probably get my arrested by the Good Design Police, but here it is anyway... ;)
    Just before the Wend, add a line label, e.g. JumpHereIfWeekend:, and in your check for weekends add the line GoTo JumpHereIfWeekend


    /Fredrik :cool:

    Hi Bob


    The problem lies in the line With ActiveChart. You have to select a chart in order to have an ActiveChart object. Either you select the chart before you click on the button or you could change the With line to:

    Code
    With ActiveSheet.ChartObjects(1).Chart


    Also, the chart type in your example is a line chart which doesn't have a MinimumScale property. If you change the chart type to Scatter plot, I think your code will work.


    HTH
    /Fredrik

    Hi arleney


    Here is some code that can be used to save a chart as a gif file. It assumes you have a chart on the active sheet. I hope this is what you are looking for.


    Code
    Sub ExportChart()
        Dim ch As Chart
        
        Set ch = ActiveSheet.ChartObjects(1).Chart
        ch.Export FileName:="c:/temp/testChart.gif", Filtername:="GIF"
    End Sub


    HTH
    Fredrik

    Hi


    The following code adds the worksheets to a combobox:

    Code
    Dim ws As Worksheet
        
        With ComboBox1
            .Clear
            For Each ws In ThisWorkbook.Worksheets
                .AddItem ws.Name
            Next
        End With


    In the Change event, use the following code to activate the selected sheet:

    Code
    Private Sub ComboBox1_Change()
        With ComboBox1
            ThisWorkbook.Worksheets(.List(.ListIndex)).Activate
        End With
    End Sub


    HTH
    /Fredrik

    Hi Joel


    I suggest you check out the Application.OnTime method. Here's an example of code that triggers it self


    Code
    Sub SaveData()
        Dim dtSaveTime As Date
        
        dtSaveTime = Now + TimeValue("00:05:00")
        Application.OnTime dtSaveTime, "SaveData"
        Call SaveDataToDatabase
    End Sub


    The code starts with triggering itself 5 minutes later and then continues running (i.e saving the data to the database)


    HTH
    /Fredrik

    Hi


    This isn't exactly the solution you asked for, but perhaps you can get some ideas from it.


    The code colors 300*255 cells with random colors and writes the random number in the cell. It runs in about 35-40s


    HTH
    /Fredrik