Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default How to Remove Macro from SaveAs file

Hi all, I have macro in normal module (see below) and file in which I
have this macro is protected by password and is "ReadOnly" so no one
can modify anything.

Macro:
===================================
Sub SF()
Dim FileNameSave As Variant
MsgBox "Please first SaveAs the file", vbInformation, "Save As First"
FileNameSave = Application.GetSaveAsFilename( _
InitialFileName:="C:\ENTER FILE NAME", fileFilter:="Excel Macro-
Enabled Workbook(*.xlsm),*.xlsm,")
If FileNameSave = False Then
MsgBox "You Must SaveAs the File before sending for Authorisation",
vbCritical, "ERROR"
Else
ThisWorkbook.SaveAs Filename:=FileNameSave, CreateBackup:=False
End If
End Sub
<====================================

I call this macro from ThisWorkbook Module which is
Private Sub Workbook_Open()
Call SF
End Sub

the macro above prompt the user to SaveAs the file when the user open
the file. I want some sort of code or someone to tell me that how can
I remove or delete just "Call SF" line from ThisWorkbook Module and
above macro which is "Sub SF()" and it is in Module 6 from the file
which will be SaveAs by user. Obvisally i dont want everything to be
deleted from the orginal file althought it cant be because file is
read only but i want thing to be deleted or removed which i mentioned
above from the new SavedAs file. I want this because i dont want that
when user open the SavedAs file he should still get messages that to
"Save the file as SaveAs". Please can any friend help me.
Reply
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
SaveAs Copying Macro to New File Rebecca_SUNY Excel Programming 1 June 9th 08 03:39 PM
Background Processes in File Save versus File SaveAs Paige Excel Programming 2 April 24th 08 11:57 PM
Macro path follows the "SaveAs" file OlieH Excel Programming 1 March 3rd 07 01:50 AM
SaveAs macro: How do I specify "Replace existing file?" [email protected] Excel Programming 1 May 24th 05 02:36 AM
Overwriting a file automatically using saveas in a macro Sam Excel Programming 5 May 5th 04 04:01 AM


All times are GMT +1. The time now is 11:41 AM.

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

About Us

"It's about Microsoft Excel"