![]() |
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 |
Urgent! Save Excel WorkBook - a special way
Hi
see your other post P.S.: please don't multipost -----Original Message----- I need to write VBA code embedded to a workbook in such a way that, if the workbook is in a particular directory (say 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 As 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 should work as it should, also (3) there should be no effect on the save Workspace option. Please help! --- Message posted from http://www.ExcelForum.com/ . |
All times are GMT +1. The time now is 02:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com