Thread: Help!!!
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Help!!!

Selection.OnAction = "'" & fileWextention & "'!Benefits"

since the file in questions has a space in the name, enclose the name in
single quotes for the assignment as shown.

--
Regards,
Tom Ogilvy


"a" wrote in message
et...
I know, I'm relentless. I'm trying to narrow this down as much as

possible.

I have a file with a procedure which loops through other files, adding a
module (that part works), but when I try to assign the macro - which is
in both the working file and the file in the loop, the macro that gets
assigned comes from the source file rather than the file in the loop if
I use this code:

Selection.OnAction = "Benefits"

If I assign a variable to the file in the loop - in this case it's "test
4516.xls" and use the following code, I error out:

Selection.OnAction = fileWextention & "!Benefits"

If I use the following code to (which refers to the source file), the
code will work and assign the macro but to the source file and not the
file I'm trying to update:

Selection.OnAction = "AddingModule2.xls!Benefits"

Can anybody tell me what I'm doing wrong?????

thanks much in advance,
Anita