![]() |
Error - Incorrect Function
Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance |
Error - Incorrect Function
What line causes the problem?
What's in Z1 of the activesheet? What's the exact error message that you see? Oggy wrote: Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance -- Dave Peterson |
Error - Incorrect Function
On 16 Apr, 12:47, Dave Peterson wrote:
What line causes the problem? What's in Z1 of the activesheet? What's the exact error message that you see? Oggy wrote: Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance -- Dave Peterson- Hide quoted text - - Show quoted text - The problem occurs when i run the macro Range Z1 is the file name which is also a purchase order number The error message is "Incorrect Function" Thanks |
Error - Incorrect Function
So how do you run this subroutine?
What particular line causes the problem? What's the actual value in Z1? Oggy wrote: On 16 Apr, 12:47, Dave Peterson wrote: What line causes the problem? What's in Z1 of the activesheet? What's the exact error message that you see? Oggy wrote: Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance -- Dave Peterson- Hide quoted text - - Show quoted text - The problem occurs when i run the macro Range Z1 is the file name which is also a purchase order number The error message is "Incorrect Function" Thanks -- Dave Peterson |
Error - Incorrect Function
On 16 Apr, 14:46, Dave Peterson wrote:
So how do you run this subroutine? What particular line causes the problem? What's the actual value in Z1? Oggy wrote: On 16 Apr, 12:47, Dave Peterson wrote: What line causes the problem? What's in Z1 of the activesheet? What's the exact error message that you see? Oggy wrote: Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance -- Dave Peterson- Hide quoted text - - Show quoted text - The problem occurs when i run the macro Range Z1 is the file name which is also a purchase order number The error message is *"Incorrect Function" Thanks -- Dave Peterson- Hide quoted text - - Show quoted text - I am running Excel 2007 and the sub routine is run by a custom xml ribbon button. The value of Z1 varies but would be on a number and letters combines ie PO15 Thanks |
Error - Incorrect Function
I don't know enough about the ribbon to know.
Oggy wrote: On 16 Apr, 14:46, Dave Peterson wrote: So how do you run this subroutine? What particular line causes the problem? What's the actual value in Z1? Oggy wrote: On 16 Apr, 12:47, Dave Peterson wrote: What line causes the problem? What's in Z1 of the activesheet? What's the exact error message that you see? Oggy wrote: Hi I have the following code in a addin to close a spreadshhet and go back to the menu. Everything works fine but i keep getting a error message Incorrect Function. Sub backtomenupo() Dim Filename As String Filename = Range("z1").Value & ".xlsm" Workbooks(Filename).Close savechanges:=True Workbooks("Menu.xlsm").Activate End Sub Please advise how i can fix this problem Thanks in advance -- Dave Peterson- Hide quoted text - - Show quoted text - The problem occurs when i run the macro Range Z1 is the file name which is also a purchase order number The error message is "Incorrect Function" Thanks -- Dave Peterson- Hide quoted text - - Show quoted text - I am running Excel 2007 and the sub routine is run by a custom xml ribbon button. The value of Z1 varies but would be on a number and letters combines ie PO15 Thanks -- Dave Peterson |
All times are GMT +1. The time now is 05:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com