Consulting

Results 1 to 4 of 4

Thread: code error going from xls 2000 to 2007

  1. #1
    VBAX Regular mike31z's Avatar
    Joined
    Apr 2005
    Location
    Highland, Wisconsin
    Posts
    98
    Location

    code error going from xls 2000 to 2007

    I have a code error that I have assigned to a Macro that worked in excel 2000 and now it doesn't work in excel 2007.

    Below is the code that worked in excel 2000.
    [VBA]ActiveWorkbook.UpdateLink Name:="R:\REGteam12.xls", Type:=xlExcelLinks[/VBA]

    I tried to add an x to the file REGteam12.xlsx I get an error
    " Runtime error '1004' Method 'updatelink' of Object '_workbook' failed"

    I think it a version difference for the code but I don't know how correct the code.

    Thanks for looking

    Mike in Wisconsin

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi...

    try:
    xlLinkTypeExcelLinks

    or:
    ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Have you changed the format of the file the link is to? If so I suspect you need changelink rather than updatelink as the link itself will now be invalid.
    Be as you wish to seem

  4. #4
    VBAX Regular mike31z's Avatar
    Joined
    Apr 2005
    Location
    Highland, Wisconsin
    Posts
    98
    Location

    Refresh Link

    I have worksheet linked to a another worksheet on LAN network with out internet access. on the other worksheet the operator enters data and then saves the open file.

    By using code above assigned to a forms button I receive new data. I have to refresh the receiving workbook as many times a 100 times in 6 hours. I has worked well in excell 2000.

    The source file is a xlsx now after converting to 2007. The receiving file is a xlsm.

    I will give both option a try and report back.

    Thanks for responding.

Posting Permissions

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