Macro "sub or function not defined"

Graham52

New Member
Joined
Jan 26, 2019
Messages
14
Hi there,
I have a macro that works fine but it seems everytime I do other work and come back to it I get this message "sub or function not defined". I have debugged it and get the following, this is the macro. I am using a Mac computer and suspect the problem may be related.
Code:
Sub SaveQoteWithNewQote()
        Dim NewFN As Variant
        ' Copy Qote to a new workbook
        ActiveSheet.Copy
        NewFN = "desktop\quotes\Quote" & Range("B1").Value & ".xlsx"
        ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
        ActiveWorkbook.Close
        NextQote
        
End Sub

The first line is is highlighted yellow and the last line (NextQote) is blue. I don't understand why it works sometimes but then refuses to work.

Thanks for any help you can give.
Graham
 
Last edited by a moderator:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
The first line is is highlighted yellow and the last line (NextQote) is blue. I don't understand why it works sometimes but then refuses to work.
Is the "NextQote" macro name spelled correctly? (I would think there should be a "u" after that "Q")
 
Upvote 0
Hi Rick, Yes I know that but at the very beginning I was having a problem using the word quote (no idea why) but I changed it to Qote and all went fine. I have had no problems but since I started using it more I am getting this fault.
 
Upvote 0
Which version of Mac Office are you using?

That file path doesn't look right for a Mac, but that wouldn't explain the error message. Do you have a routine called NextQote in your code?
 
Upvote 0
Hi again, Its Excel 2016 but that path has worked before, if I run it in Finder and look for its path that is what comes up.
 
Upvote 0
And my other question?
 
Upvote 0
I'm almost certain its Office 365 if that's what you are after, it is on the work computer and I am at home now. Is that the question you mean?
 
Upvote 0
The other question was "Do you have a routine called NextQote in your code?"
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top