Why get Ref in my cells ?

M

Mario Reiley

Hi group

I'm change the link on my Worksheets via VBA code and all in fine but the
results are wrong. All the time get REF errors.

Why don't get my Results ?

Here is my code:

Private Sub ChangeMyLinkBath()
ActiveWorkbook.ChangeLink Name:= _
"C:\My Project\MODULO SDN-SCI\Productos
Requeridos\Mecanica\Documentos\Bombas\H.C. Bombas SCI .xls" _
, NewName:= _
"C:\My Project\H.C. Bombas SCI .xls" _
, Type:=xlExcelLinks

End Sub

Any Advisor is Wellcome
Mario
 
J

Jake Marx

Hi Mario,

Are you sure the filenames are correct in your code? Try this in the
Immediate Window (Ctrl+g from the VBE):

?Dir$("C:\My Project\MODULO SDN-SCI\Productos
Requeridos\Mecanica\Documentos\Bombas\H.C. Bombas SCI .xls")

?Dir$("C:\My Project\H.C. Bombas SCI .xls")

Do you get values for each of these statements, or does one of them return
an empty string?

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
M

Mario Reiley

Hi, Jake thanks for the response

?Dir$("C:\My Project\MODULO SDN-SCI\Productos
Requeridos\Mecanica\Documentos\Bombas\H.C. Bombas SCI .xls")

?Dir$("C:\My Project\H.C. Bombas SCI .xls")

don't return anything what is happenig , please let me know ..!

Mario


Jake Marx said:
Hi Mario,

Are you sure the filenames are correct in your code? Try this in the
Immediate Window (Ctrl+g from the VBE):

?Dir$("C:\My Project\MODULO SDN-SCI\Productos
Requeridos\Mecanica\Documentos\Bombas\H.C. Bombas SCI .xls")

?Dir$("C:\My Project\H.C. Bombas SCI .xls")

Do you get values for each of these statements, or does one of them return
an empty string?

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mario said:
Hi group

I'm change the link on my Worksheets via VBA code and all in fine but
the results are wrong. All the time get REF errors.

Why don't get my Results ?

Here is my code:

Private Sub ChangeMyLinkBath()
ActiveWorkbook.ChangeLink Name:= _
"C:\My Project\MODULO SDN-SCI\Productos
Requeridos\Mecanica\Documentos\Bombas\H.C. Bombas SCI .xls" _
, NewName:= _
"C:\My Project\H.C. Bombas SCI .xls" _
, Type:=xlExcelLinks

End Sub

Any Advisor is Wellcome
Mario
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top