LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro assigned to custom button - keeps changing

Hi

I have a macro which deleteds the headings from a
worksheet, saves the file as a .prn file and emails it to
someone.

Tested macro several times and it works fine so I have
created a custom button on toolbar and assigned the macro
to it.

My problem is that when the macro is run for the first
time the button assignment in the original file is
changed to a macro in the .prn file (but the macro is not
saved in the file so does not exist).

So the next time the button is pressed - Excel cannot
find the macro!

Any ideas what is causing this and how to stop it?

Any help at all would be greatly appreciated.


The macro is as follows(don't know if something in the
macro is causing this or not):

Sub Mail_ActiveSheet()

Dim strdate As String
Dim wb As Workbook
Dim CurrFile As String

Set wb = ActiveWorkbook
CurrFile = ActiveWorkbook.FullName
ActiveWorkbook.Save
strdate = Format(Now, "mm-dd-yy")

Rows("1:1").Select
Selection.Delete Shift:=xlUp

ActiveWorkbook.SaveAs Filename:="C:\CAR\" & strdate
& ".prn", FileFormat:=xlTextPrinter, CreateBackup:=False
ActiveWorkbook.SendMail ", _
"CarLoanFile"


Workbooks.Open CurrFile
wb.Close False


End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro assigned to a button Sadcrab Excel Discussion (Misc queries) 12 December 8th 06 11:16 PM
Macro Assigned to a Button zephyr Excel Discussion (Misc queries) 1 October 25th 06 03:33 PM
Custom Toolbar Button No Longer Runs Assigned Macro Bryan Excel Discussion (Misc queries) 1 April 10th 06 06:02 PM
How do I know what macro is assigned to a button? Denise in NC Excel Discussion (Misc queries) 3 April 3rd 06 02:31 PM
Macro assigned to a button question Anita[_2_] Excel Programming 1 July 30th 03 06:21 PM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"