VBA code/variable? for filename

Status
Niet open voor verdere reacties.

slaine06

Nieuwe gebruiker
Lid geworden
22 apr 2009
Berichten
4
Hello,

I created a macro what makes in a cell a hyperlink of the filename and the path and copy the link to the clipboard. It works, i made a template of it and put it in XLstart "normal.xlsm". Now if i open excel and i make a new filename and save it on the place i want because of changing the name the macro won't work anymore, here's the code:

Application.Run "normal.xlsm!Filename"
Application.CutCopyMode = False
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
ActiveWorkbook.FullName, TextToDisplay:= _
ActiveWorkbook.FullName
If i want for instance make a "test.xlsm" i have to change "normal.xlsm" into "test.xlsm" and then it works. How can i make a code without changing everytime the filename???
Thanks in advance...
 
I haven't got the fogiest.
But if you try to rephrase the question in plain Dutch, you might even get an answer!

Enjoy!
 
oplossing

I haven't got the fogiest.
But if you try to rephrase the question in plain Dutch, you might even get an answer!

Enjoy!

Hallo allemaal,

Sorry dat het in't engels was, maar ik heb gewoon een copy/paste gedaan van een andere forum.(khad weinig tijd)Maar ik heb de oplossing gevonden.
Die application.run... deed een andere macro werken met een verwijzing naar de filename.
Nu heb ik de code van die macro erin geplaatst in plaats van application.run..., nu zoekt hij niet meer naar de filename normal.xlsm

Toch bedankt :)
 
Bedankt voor de terugkoppeling. Daar hebben we allemaal wat aan.

Enjoy!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan