Macro problem

C

Connie

This macro has always worked like a charm. Obviously a
few days ago I did something, which I have no idea what,
and this macro is looking at another file before it will
run. Let me explain.

When I open the file, I get the usual wording about
whether I want to enable or disable macros. I
click "enable", of course. Then in the file I have a date
button that I click on and it inserts the last business
day date, locks the date so it doesn't continually update
each time the saved file is opened. Then the cursor moves
to the first cell where I begin entering data. This was
all when the file was working like a charm. Now, when I
click on the date button it looks at another file saying
it contains macros (a file I created on 5/11/04), and when
I click on enable macros, it opens that other file before
it runs the macro in the new file. HOWEVER, if instead of
clicking on my date button, I select "Run" from
Tools/Macros, it works without looking at the other file.

What is happening here?
 
C

Connie

Sub DateLock()
'
' DateLock Macro
' Macro recorded 9/2/2003 by Sealed Air Corporation
'

'
Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=WORKDAY(TODAY(),-1,'2004 Holidays'!R[-3]C[-1]:R
[6]C[-1])"
Range("B4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A18").Select
End Sub
 
F

Frank Kabel

Hi
have you checked that the button is not assigned to a macro in a
different workbook?



--
Regards
Frank Kabel
Frankfurt, Germany

Sub DateLock()
'
' DateLock Macro
' Macro recorded 9/2/2003 by Sealed Air Corporation
'

'
Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=WORKDAY(TODAY(),-1,'2004 Holidays'!R[-3]C[-1]:R
[6]C[-1])"
Range("B4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A18").Select
End Sub


-----Original Message-----
Hi
you may post the code of your macro

--
Regards
Frank Kabel
Frankfurt, Germany


.
 
C

Connie

I never thought of that! And yes, it WAS assigned to that
other workbook! Strange! How that ever got changed, I'll
never know! Thanks for your help. The macro is working
properly now.

-----Original Message-----
Hi
have you checked that the button is not assigned to a macro in a
different workbook?



--
Regards
Frank Kabel
Frankfurt, Germany

Sub DateLock()
'
' DateLock Macro
' Macro recorded 9/2/2003 by Sealed Air Corporation
'

'
Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=WORKDAY(TODAY(),-1,'2004 Holidays'!R[-3]C[- 1]:R
[6]C[-1])"
Range("B4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A18").Select
End Sub


-----Original Message-----
Hi
you may post the code of your macro

--
Regards
Frank Kabel
Frankfurt, Germany


Connie wrote:
This macro has always worked like a charm. Obviously a
few days ago I did something, which I have no idea what,
and this macro is looking at another file before it will
run. Let me explain.

When I open the file, I get the usual wording about
whether I want to enable or disable macros. I
click "enable", of course. Then in the file I have a date
button that I click on and it inserts the last business
day date, locks the date so it doesn't continually update
each time the saved file is opened. Then the cursor moves
to the first cell where I begin entering data. This was
all when the file was working like a charm. Now, when I
click on the date button it looks at another file saying
it contains macros (a file I created on 5/11/04), and when
I click on enable macros, it opens that other file before
it runs the macro in the new file. HOWEVER, if instead of
clicking on my date button, I select "Run" from
Tools/Macros, it works without looking at the other file.

What is happening here?
.

.
 
F

Frank Kabel

Hi
thanks for the feedback :)

--
Regards
Frank Kabel
Frankfurt, Germany

I never thought of that! And yes, it WAS assigned to that
other workbook! Strange! How that ever got changed, I'll
never know! Thanks for your help. The macro is working
properly now.

-----Original Message-----
Hi
have you checked that the button is not assigned to a macro in a
different workbook?



--
Regards
Frank Kabel
Frankfurt, Germany

Sub DateLock()
'
' DateLock Macro
' Macro recorded 9/2/2003 by Sealed Air Corporation
'

'
Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=WORKDAY(TODAY(),-1,'2004 Holidays'!R[-3]C[- 1]:R
[6]C[-1])"
Range("B4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A18").Select
End Sub



-----Original Message-----
Hi
you may post the code of your macro

--
Regards
Frank Kabel
Frankfurt, Germany


Connie wrote:
This macro has always worked like a charm. Obviously a
few days ago I did something, which I have no idea what,
and this macro is looking at another file before it will
run. Let me explain.

When I open the file, I get the usual wording about
whether I want to enable or disable macros. I
click "enable", of course. Then in the file I have a date
button that I click on and it inserts the last business
day date, locks the date so it doesn't continually update
each time the saved file is opened. Then the cursor moves
to the first cell where I begin entering data. This was
all when the file was working like a charm. Now, when I
click on the date button it looks at another file saying
it contains macros (a file I created on 5/11/04), and when
I click on enable macros, it opens that other file before
it runs the macro in the new file. HOWEVER, if instead of
clicking on my date button, I select "Run" from
Tools/Macros, it works without looking at the other file.

What is happening here?
.

.
 
Top