Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have one private sub that prevents the Master file from being saved
over. It is as follows... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean) If SaveAsUI Then Exit Sub If ThisWorkbook.Name < "061 Master.xls" Then Exit Sub MsgBox "Press 'Ctrl s' to save." Cancel = True End Sub Then I have a macro that uses "ctrl s" as a shortcut. This macro automatically saves the file based on the contents of a cell. The problem is that "ctrl s" never works. I always get the msg saying to Press ctrl s to save. This is the code for saving Sub dateSave() ChDrive "C:\" ChDir "C:\Documents and Settings\tsmith\desktop\reports" ActiveWorkbook.SaveAs Filename:=Range("B60").Value End Sub I checked cell B60 and it does not contain the label "061 Master". What's going on??! --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try Sub dateSave() ChDrive "C:\" ChDir "C:\Documents and Settings\tsmith\desktop\reports" application.enableevents=false ActiveWorkbook.SaveAs Filename:=Range("B60").Value application.enableevents=true End Sub -- Regards Frank Kabel Frankfurt, Germany I have one private sub that prevents the Master file from being saved over. It is as follows... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean) If SaveAsUI Then Exit Sub If ThisWorkbook.Name < "061 Master.xls" Then Exit Sub MsgBox "Press 'Ctrl s' to save." Cancel = True End Sub Then I have a macro that uses "ctrl s" as a shortcut. This macro automatically saves the file based on the contents of a cell. The problem is that "ctrl s" never works. I always get the msg saying to Press ctrl s to save. This is the code for saving Sub dateSave() ChDrive "C:\" ChDir "C:\Documents and Settings\tsmith\desktop\reports" ActiveWorkbook.SaveAs Filename:=Range("B60").Value End Sub I checked cell B60 and it does not contain the label "061 Master". What's going on??! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
does the macro work if you invoke it manually? -- Regards Frank Kabel Frankfurt, Germany ..Still having the same problem?? ~ --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try setting a breakpoint in your macro and invoke it manually. What happens? -- Regards Frank Kabel Frankfurt, Germany Nope, tried that too. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conflicting Calculations | Excel Discussion (Misc queries) | |||
Permutations with conflicting groups | Excel Discussion (Misc queries) | |||
Conflicting vlookups | Excel Worksheet Functions | |||
Conflicting results in formulas? | Excel Worksheet Functions | |||
Conflicting date ranges | Excel Worksheet Functions |