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 Urgent! Save Excel WorkBook - a special way

I need to write VBA code embedded to a workbook in such a
way that, if the workbook is in a particular directory (sa
C:\WinNT\Temp) , the save option work as "SaveAs"

(Or in otherway to behave the WorkBook as if
it is never saved... ThisWorkBook.Path = "")

I tried to write in the thisWorkBook Module ...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
Dim bCodeRunning As Boolean
bCodeRunning = False
If ThisWorkBook.Path = strTempDir Then
If bCodeRunning Then
Application.Dialog(xlSaveAs).Show
bCodeRunning = False
Else
bCodeRunning = True
End If
End If
End Sub


What else I need to do to get the desired effect?
Conditions include 1) it shuld never crash (2) saveAs option shoul
work as it should, also (3) there should be no effect on the sav
Workspace option.
Please help

--
Message posted from http://www.ExcelForum.com

 
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
IME MODE FOR EXCEL 2007 (URGENT URGENT) Stella Wong Excel Discussion (Misc queries) 1 August 23rd 08 11:16 PM
ALLOWING ONLY PASTE SPECIAL (URGENT) FARAZ QURESHI Excel Discussion (Misc queries) 5 January 1st 07 08:47 PM
Why do the cells I am custom formatting save in special, polish Drm2B Excel Worksheet Functions 0 August 8th 05 10:27 PM
Excel Save As... text with special characters Brynturk Excel Discussion (Misc queries) 2 June 23rd 05 02:59 AM
URGENT!!! shared workbook A.G.M ash New Users to Excel 1 May 26th 05 10:14 PM


All times are GMT +1. The time now is 11:59 PM.

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"