+ Reply to Thread
Results 1 to 13 of 13

DDE and updating

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2006
    Location
    Cheshire, UK
    Posts
    47

    Ardus

    Dear Ardus,

    Started programme as instructed; following messages appeared:

    On Run CopyValue, “Runtime Error ‘9’ Subscript out of range”

    On Run StopTimer, “Runtime Error ‘104’ Method ‘OnTime’ of object_Application failed"

    Any suggestions, please?

    Regards,

    Grant.

  2. #2
    Registered User
    Join Date
    05-30-2006
    Posts
    3

    Ardus Petus, may I also request your assistance?

    I am also working with a DDE and have questions on updating my data tables. I hope you both don't mind my participation in this thread.

    My Dilemma: IF PRICE > HIGH, THEN capture the new HIGH value, ELSE show current HIGH value.

    Solution 1: Uncertain how to approach this problem, I attempted to go with something familiar: =IF(PRICE > HIGH, PRICE, HIGH).
    Unfortunately, I discovered this does not record the new price. It only confirms the condition that a new HIGH has been reached during the current period.

    Solution 2: Create a macro to paste PRICE values to HIGH.
    While this solution does record the change in values, I have not been able to automate the macro.

    Sub Macro1()
    'COPY PRICE
    Range("PRICE").Select
    Selection.Copy

    'PASTE VALUES TO HIGH
    Range("HIGH").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    ActiveSheet.Paste
    Application.CutCopyMode = False
    End Sub

    My questions are,
    1) Is it possible to create a function using the Selection.PasteSpecial Paste:=xlValues vba command?

    2) Can vba and macro commands be written into a conditional format or into a Logical Function formula? Into other types of Excel Functions?

    3) In your opinion, what is the most effective method for automating the paste values vba command?

    4) What skill sets should I review before creating this next solution? By the way, I have access to Jeff Webb's "Using Excel Visual Basic for Applications," "Excel Bible 2003," and "MOS 2003 Study Guide," not to mention access to study sections at sites like ExcelTip, so review and learning shouldn't be much of a problem.

    Thanks.

  3. #3
    Ardus Petus
    Guest

    Re: DDE and updating

    Change line:
    With Worksheets("Data")
    and replace "Data" with your worksheet name.

    HTH
    --
    AP

    "grant606" <[email protected]> a écrit
    dans le message de news:
    [email protected]...
    >
    > Dear Ardus,
    >
    > Started programme as instructed; following messages appeared:
    >
    > On Run CopyValue, "Runtime Error '9' Subscript out of range"
    >
    > On Run StopTimer, "Runtime Error '104' Method 'OnTime' of
    > object_Application failed"
    >
    > Any suggestions, please?
    >
    > Regards,
    >
    > Grant.
    >
    >
    > --
    > grant606
    > ------------------------------------------------------------------------
    > grant606's Profile:
    > http://www.excelforum.com/member.php...o&userid=35077
    > View this thread: http://www.excelforum.com/showthread...hreadid=548264
    >




  4. #4
    Registered User
    Join Date
    06-04-2006
    Location
    Cheshire, UK
    Posts
    47
    Ardus,

    No joy, I'm afraid. Searching for Error Messages via Google, a thousand and one possibilities are presented. However, unbeknown to myself, there seems to be a difference between workbooks, worksheets and files.

    One explanation said there had to be a minimum of three sheets to a workbook. All I know is I have a file called MY TIMER.xls - there are no sheets (I set the default to 1). Now I have changed this to 3. In vain.

    Should the code still refer to
    With Worksheets ("MY TIMER")
    (and should I include the .xls suffix)?

    Grant.

+ 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