Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default PLEASE CAN ANY BODY HELP

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default PLEASE CAN ANY BODY HELP

Create an If statement before you make the call statement. If
activeworkbook.name = the original workbook name, call the saveas, else go to
the next step.
--
Larry


"K" wrote:

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
PLEASE CAN ANY BODY HELP K[_2_] Excel Programming 2 April 25th 08 03:50 PM
Please any body help me.i need help as soon as possible [email protected] Excel Discussion (Misc queries) 0 June 20th 07 07:55 AM
Any body help me out with this? wwwrabbit Excel Discussion (Misc queries) 3 June 15th 06 08:46 PM
can some body help me ditzafar[_2_] Excel Programming 5 December 8th 05 06:27 PM
Can any body help? darno[_17_] Excel Programming 1 March 6th 04 11:33 PM


All times are GMT +1. The time now is 05:27 PM.

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"