Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
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
IF function returning incorrect result Hillary E. Excel Worksheet Functions 2 August 22nd 06 05:43 PM
Incorrect Formula Error jermsalerms Excel Discussion (Misc queries) 2 January 18th 06 06:49 PM
Incorrect Counting of IF function kaz ogonowski Excel Worksheet Functions 5 January 1st 06 04:06 AM
RSQ function gives incorrect result imurch Excel Worksheet Functions 1 November 4th 05 01:35 PM
Sum Function sometimes displays incorrect answer John Westgate Excel Worksheet Functions 4 January 18th 05 12:16 PM


All times are GMT +1. The time now is 08:20 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"