PDA

View Full Version : code error going from xls 2000 to 2007



mike31z
07-11-2012, 08:47 AM
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.
ActiveWorkbook.UpdateLink Name:="R:\REGteam12.xls", Type:=xlExcelLinks

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

mancubus
07-12-2012, 06:54 AM
hi...

try:
xlLinkTypeExcelLinks

or:
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources

Aflatoon
07-12-2012, 07:06 AM
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.

mike31z
07-12-2012, 07:31 AM
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.