Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help!!!
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Thank you Tog Ogilvy!!!!!!!
Such a small thing and it has been driving me crazy. Thank you again,
Tom Ogilvy! Tom Ogilvy wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|