Excel 2007 Compile Error Argument Not Optional
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Excel Vba Compile Error Argument Not Optional
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x compile error argument not optional vb6 Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it
Excel 2007 Compile Error In Hidden Module
only takes a minute: Sign up My Excel 2007 macro - what does Argument not optional mean? up vote 2 down vote favorite Please advise me what is wrong with my Excel 2007 macro thank you very much excel vba compile error in hidden module excel 2007 macro share|improve this question edited Aug 17 '11 at 8:37 aevanko 9,88022942 asked Aug 17 '11 at 7:26 Nathaniel_613 1272728 Learn how to ask any question tinyurl.com/so-hints –Sangram Aug 17 '11 at 7:32 1 Can you revise this so the readable text of your question actually exceeds the markup used to display the image? How would anyone find this question by searching? –Tim Post♦ Aug 17 '11 at 7:40 add a comment| 4 Answers 4 active oldest votes compile error in hidden module excel 2007 windows 7 up vote 1 down vote accepted If a parameter is supposed to be sent to a function by its definition but it is not sent, this error occurs. Please note that you can assign optional paramters like this: Function Something(ByVal text as String, Optional number as Long = 26) By placing the Optional keyword, the function can still be called even without that paramater being passed in to it. The = xxx is where you put the default value in the case that it is not provided. If you decide not to declare the type of the Optional paramter (making it a Variant), you can use the ultra convenient IsMissing() function to see if it was passed in or not. share|improve this answer edited Aug 17 '11 at 8:36 answered Aug 17 '11 at 8:08 aevanko 9,88022942 add a comment| up vote 2 down vote The function needs one or more parameters (argument) which you didn't provide. And since that argument is not optional, meaning you have to provide it, Excel can't execute your macro. share|improve this answer answered Aug 17 '11 at 7:33 Nodebody 743310 2 You can find full details of the InchesToPoints function here –Xav Aug 17 '11 at 7:37 Nice link Xav.. –Sangram Aug 17 '11 at 7:43 add a comment| up vote 1 down vote You are not passing a number into the second call to inchesToPoints() share|improve this answer an
not optional If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can
Vba Argument Not Optional Function
post: click the register link above to proceed. To start viewing messages, select argument not optional when calling function the forum that you want to visit from the selection below. Results 1 to 13 of 13 Thread: [RESOLVED]
Argument Not Optional Vba Call
compile error: argument not optional Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jun 8th, 2007,09:03 AM #1 loverman210 http://stackoverflow.com/questions/7089222/my-excel-2007-macro-what-does-argument-not-optional-mean View Profile View Forum Posts Thread Starter Junior Member Join Date Jun 2007 Posts 17 [RESOLVED] compile error: argument not optional Hello to everyone! I'm new to programming, and in fact I'm so new that I even need some help to start programming!! Using VB 6.0 this is the code: Private Sub Command1_Click() MsgBox ''hello'' End Sub that's all! then I run it and http://www.vbforums.com/showthread.php?473038-RESOLVED-compile-error-argument-not-optional get the message: ''compile error: argument not optional'' any help would be much appreciated! thanks in advance!! using WinXP Sp2 and Visual Basic 6 classic Reply With Quote Jun 8th, 2007,09:08 AM #2 Hack View Profile View Forum Posts Super Moderator Join Date Aug 2001 Location Searching for mendhak Posts 58,335 Re: compile error: argument not optional Welcome to the forums. Code: Private Sub Command1_Click() MsgBox "Hello" End Sub That works just fine. There has to be something else going on in your program. Does this error occur when you click the button or when you start your project? Please use [Code]your code goes in here[/Code] tags when posting code. When you have received an answer to your question, please mark it as resolved using the Thread Tools menu. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section. Creating A Wizard In VB.NET Paging A Recordset What is wrong with using On Error Resume Next Good Article: Language Enhancements In Visual Basic 2010
Way | Trading Add-ins For Excel | Convert Excel Into Calculating Web Pages Excel Web Pages | Produce Clean Efficient VBA Code Every Time | Build Automated Trading Models In Excel | Excel Web Pages | Excel Video Training http://www.ozgrid.com/forum/showthread.php?t=18091 Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts What's New? Advanced Search Forum HELP FORUMS Excel General "Argument not optional" how do i deal with this Excel Training / Excel Dashboards Reports If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the compile error forum that you want to visit from the selection below. If you don't like Google AdSense in the posts, register or log in above. Click here to view the relaunched Ozgrid newsletter. Results 1 to 6 of 6 Thread: "Argument not optional" how do i deal with this Thread Tools Show Printable Version Search Thread Advanced Search January 30th, 2004 #1 bourassa View Profile View Forum Posts I agreed to these rules Join Date 27th January argument not optional 2004 Posts 16 i keep getting this error when i am tring to call this function Function totalitems(totalitems) UserRowCounter = UserStartRow While Worksheets("Log-Import").Cells(UserRowCounter, UserStartCol) <> "" UserRowCounter = UserRowCounter + 1 Wend totalitems = UserRowCounter End Function 'function to be the do all end all find logoff for each coresponding logon. Function Findlogoff(totalitems) itemcount = 0 totalitems (totalitems) For counter = 1 To totalitems If LogCol = "logoff" Then If UsernameCol = username Then If DayCol = UserDayCol Then Worksheet(username).Cells(userrow, UserLogoffCol).Value = Worksheets("log-import").Cells(logrow, LogCol).Value itemcount = itemcount + 1 End If End If End If Next counter If itemcount = 0 Then MsgBox "there were no logoffs found for & username & on that day. would you like to continue." End If End Function 'Call a logoff function here Findlogoff (totalitems) please help this is the last thing i need i promise Excel Video Tutorials / Excel Dashboards Reports Reply With Quote January 30th, 2004 #2 Derk View Profile View Forum Posts OzMVP (The Professor) Join Date 15th April 2003 Location USA Posts 7,528 I suspect the problem is with Function totalitems(totalitems) The argument totalitems is also the name of the function, so it is trying to call itself but can't because it doesn't have an argument in the second call. It doesn't appear that the function actually needs an argument, so try it just as Function totalitems Excel Video Tutorials