Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conflicting VB Code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Conflicting VB Code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conflicting VB Code

...Still having the same problem??

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Conflicting VB Code

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/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conflicting VB Code

Nope, tried that too

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Conflicting VB Code

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
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
Conflicting Calculations Kay Excel Discussion (Misc queries) 1 February 16th 10 10:41 PM
Permutations with conflicting groups tomm tomm Excel Discussion (Misc queries) 1 January 28th 10 02:18 AM
Conflicting vlookups Bruister via OfficeKB.com Excel Worksheet Functions 1 October 17th 09 04:57 PM
Conflicting results in formulas? mikelee101[_2_] Excel Worksheet Functions 4 March 26th 08 02:50 AM
Conflicting date ranges Darknexxus Excel Worksheet Functions 0 October 4th 05 04:37 AM


All times are GMT +1. The time now is 02:15 AM.

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"