Unable to run excel macro after changing file name

After changing the filename in an excel macro, receiving Error number 5 - 
Invalid procedure call or argument when users with excel 2000 run the macro.  
Users with excel 2003 are not having this issue
0
merf1 (2)
6/14/2005 1:00:01 PM
excel.newusers 15348 articles. 2 followers. Follow

2 Replies
866 Views

Similar Articles

[PageSpeed] 28

Post the line of code that is causing the error.


-- 
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"merf" <merf@discussions.microsoft.com> wrote in message 
news:F68DF323-214D-4F01-8D8E-654F9500242E@microsoft.com...
> After changing the filename in an excel macro, receiving Error 
> number 5 -
> Invalid procedure call or argument when users with excel 2000 
> run the macro.
> Users with excel 2003 are not having this issue 


0
chip1 (1821)
6/14/2005 1:46:10 PM
Here is the macro code:

    Dim Message, Title, Default, OperID, Response
    Message = "Enter the  PeopleSoft User ID of the person who ran the 
report:"
    Title = "Format Daily Hire Report: PeopleSoft User ID"
    OperID = InputBox(Message, Title)
    fName = 
"\\OMACSAN01\PEOPLESOFT\Report_Output\user\Reports\DAILY-REPORT-" & OperID & 
".CSV"
    
    With Application.FileSearch
        .NewSearch
        .LookIn = "\\OMACSAN01\PEOPLESOFT\Report_Output\user\Reports"
        .Filename = fName
        Workbooks.Open Filename:=fName

After hitting 'Workbooks.Open Filename:=fName' is when we receive the error.
Thanks for your help.

"Chip Pearson" wrote:

> Post the line of code that is causing the error.
> 
> 
> -- 
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
> 
> 
> "merf" <merf@discussions.microsoft.com> wrote in message 
> news:F68DF323-214D-4F01-8D8E-654F9500242E@microsoft.com...
> > After changing the filename in an excel macro, receiving Error 
> > number 5 -
> > Invalid procedure call or argument when users with excel 2000 
> > run the macro.
> > Users with excel 2003 are not having this issue 
> 
> 
> 
0
merf1 (2)
6/14/2005 2:16:08 PM
Reply:

Similar Artilces:

Excel in Office for Mac 2008 features
I've had Excel crash numerous times the first day using it. THe Auto Save feature does not seem to be working. Each time it crashes it brings back the old saved spreadsheet with none of the changes. Auto Save is set to 10 minutes and sometimes it had been hours and still reverted back to the old saved sheet and not the updated autosaved one. In article <ee8a70d.-1@webcrossing.caR9absDaxw>, Foosh@officeformac.com wrote: > I've had Excel crash numerous times the first day using it. THe Auto Save > feature does not seem to be working. Each time it crashes it brings back th...

Unable to open Outlook2003. Error: MAPI unable loading msncon.dll
I am trying to set up Outlook 2003 on home computer but keep getting the following message when trying to open application. MAPI was unable to load the information service msncon.dll. Since I am not open to open, I cannot get to the help feature. Please advise Have you downloaded the latest MSN Connector from their site? Or, if not using it, have you uninstalled it? Try opening Outlook in Safe mode (start->run->outlook.exe /safe) and go into the Advanced options and uncheck it from add-in manager or COM add-ins. --� Milly Staples [MVP - Outlook] Post all replies to the group to ...

Changing from One Side to Two Sided Printing
I've got a spreadsheet with multiple tabs. To change from one sided printing to two sided printing, it seems that I have to go to each tab, click on page setup, on the page tab select options and then change from one sided to two sided printing. I can't select all of the tabs and do this change globally. Am I doing something wrong? Is there a better (easier) way to do this? Thanks, Bill Allen Group the sheet: click on the first tab; hold SHIFT;click on the last tab Now set the printer option BTW: You have a WORKBOOK with multiple WORKSHEETS. "tabs" are the do-hick...

How can I change the default pushbutton in a dialog?
Hi to all, Can someone please tell me what is the use of CDialog::SetDefID() and CDialog::GetDefID()? I tried to use them to change the default button of a dialog without success. Here's what I did: - Created an MFC dialog-based application. I called the project "Def" and therefore a class called "CDefDlg" is created. When I run the application a dialog box with "OK" and "Cancel" buttons is displayed. The "OK" button being the default button. - From the resource editor I added two buttons "Button1" (IDC_BUTTON1) and ...

Word Wrapping in Excel
I am having trouble with Word Wrapping in Excel. It does not adjust th row height properly. I have tried Format, Rows, AutoFit and it stil doesn't work. Help, pleas -- Mandy1 ----------------------------------------------------------------------- Mandy11's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1300 View this thread: http://www.excelforum.com/showthread.php?threadid=27632 Hi do you experience this with merged cells. If yes->nothing you can really do about this without using vBA -- Regards Frank Kabel Frankfurt, Germany Mandy11 wrote: > I...

Exchange restore and recent file
Hello, I make an exchange Restoration from my exchange 2000 (SP3) server and i use "setup.exe /disasterrecovery" from the exchange CD-ROM.. The trouble is that it ask me for some file : " the target file is more recent that the source file, would you keep your file ? yes - no- no for all.. I don't know what to do ? because i will update to the exchnage SP3 after...and install the POST SP3 Rollup too ... Is there an exchange tool or a command that control and says if exchange works fine or not ??? for me to control after my restore.. Thanks for helping me... You can safe...

Horizontal line chart
Hi, I have prepared a bundle of column that has one XY scatter plot serie It works great, updates with VBA, no problem. Now I was asked to add one additional point in each serie to the char with some calculations. Although looked to be be very easy job, it' not, as the file get corrupted while modyfing the data source for thi chart using the MS chart interface. I've tried to put the modificatio into the command line and it works for the chart. Unfortunately it doe not record while macro recoding ('Macro recording not possible' error that is essential to update automatically t...

Unable to Edit/Add records on Form in a New ADP
I just started playing around with rebuilding a MDB file as an ADP. I built a form and subform from scratch, but I'm unable to edit or add records. SELECT Id, LoadDate, TrailerDOTNumber, SealNumber, SealDate, SealId, LoadLocation, LoadStatus, DispatchStatus, DispatchLocationId, DispatchUserId FROM TrailerActivityHeaders ORDER BY LoadDate Recordset Type: Updatable Snapshot I'm getting the 'This recordset is not updatable' Ideas? Never mind... (Does anyone have a spare bandage btw? I cut my head banging it on the wall due to my stupidity...) "D...

Sort by Last Name #2
Sorry if this posted twice. I have waited about 1/2 hour and my original post is not showing up. I am sure I phrased this better the first time but here goes. I am using Crystal Reports to extract data from our practice management system which stores the patient's name as last_name, first_name, i.e. Doe, John F. i then run a formula in Crystal Reports to switch the name around to John F. Doe. I then export the file to Excel (simple name address c/s/z file) they use for mail merge of letters and other fun stuff through out the year. Once the data is in Excel, they want to be able to ...

Case Modified Date/Time update on changes
Having the ModifiedOn date and time update on changes to related notes, activities or even just the OnSave event would be much more useful when reporting on neglected cases. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Com...

Office 2007 Excel
Every time i open Excel 2007 i get the following; "The file you are trying to open,'PDFMaker.OLDxla',is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" I pressed CTRL+Shift+I and receive the folowing id 101786 however I could not find anything relating to the above. As a note you have to press NO two times before you can get into excel. Hope I got this in the correct discution group. If you're not using the pdfmaker.* addin, how...

Unable to open calendar
Folks, i cannot open or view my calendar. When I start Oultook a Pop Up appears saying "Could not read the Calendar" On clicking Ok, the pop up vanishes and nothing happens. If i then go over to my calendar, it says "Cannot display the folder" I have run Oultook Diagnostics and nothing shows up as irregular. I ran the repair function (off my setuo CD) and nothing happened. I also re-installed Outlook and rebooted my comp and nada. When staring in safe mode i also get he same errors. I am using Off 2007, Win 7 TIA, P "phamiltonsmith" <...

using embedded .xsd vs file based .xsd
I am thinking of embedding my schemas as embedded resources instead of reading it using URI at run-time. I came across some snags while trying to do just that such as, previously unknown to me, XmlValidatingReader.Schemas.Add was using XmlValidatingReader.Resolver to resolve my schemas using the URI method. Resolver property was never set, so the reader simply ignored any external references even though one of the schema explicitly imports the other one. I verified this by removing the referred schema from the schema collection, and the code chugged along fine. But when I changed the code to ...

unable to download emails and unable to stop synchronization
I am going to try one more time to get this fixed. My Outlook 2003 has been unable to download emails. While it is trying, a small box in the tray section shows up and it states that it is trying to synchronize folders. After a time out time Outlook gives me errors. This is the error message. It has these numbers 0X800CCC15 , or 0X8004210A, or 0X8004210B, which these error messages state that either I did not have enough timeout or look and see if server name is wrong. All of you have given me these suggestions. no joy. Thank you very much however. I went ahead and finally found a sect...

Change Icon for XLT and resulting XLS
Hello, I have created an XLT which is used very frequently at my workplace. There are multiple files on our drive made using this template, and I need a way for them to differentiate themselves from other excel files. After many failed attempts to convince my coworkers to save their resulting spreadsheets using a simple naming convention, I come to this group. Is it possible, at all, for the spreadsheets that are created when the XLT is opened to have a unique icon (I have already created the icon)? I've read many posts here about changing the icons for individual workbooks, for excel...

in excel formula the comma (,) is no longer accepted but the semi.
when entering formula in Excel the comma (,) is no longer accepted but the semicolon (;) now has to be used. Example: Previous : =if(a2="Yes",a3+a4,b3+b4) Now : =if(a2="Yes";a3+a4;b3+b4) How do I change it back to using commas. I don't know how this has happened, I just arrived at work one day and the changes has occured. Not a 100% sure how well XL honors them, but check your Windows 'Regional Settings.' -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <5...

Run a Query using VBA without User Interface
Hello, I have a VBA Macro that Opens an Append Query (see below), which works great, except for the end user has to answer the following MsAccess prompts: 1) You are about to run an append query that will modify data in your table. (They have to click Yes) 2) You are about to append 1 row(s). (They have to click Yes) I'd rather them not have to answer either question. Instead I'd like the Append Query to run and do what it's asked without any human intervention. Can this be done? Please help! VBA Macro Code: DoCmd.OpenQuery "tblTask_List Query", acViewNorm...

Change of recipient/sender display name
Hi All, Environment :- Windows 2003 x64 with exchange 2007 (All in one role) Outlook client :- 2003, 2007 We have created a list of mail contacts (which under GAL) in exchange 2007, these mail contacts are associates with external email address, each of contact has a naming standard for display name, for example, display name is HD Finance Manager, external email address is fin_manager@hdemea.com I want to configure outlook client to show the display name according to mail contacts whenever the email address is match to mail contacts list (GAL), for example, an email sent from the email a...

unable to scroll the page
on microsoft office frontpage 2003 - when i up loaded my web pages to my web site www.millertimeauction.com , there is no sroll bar for up & down of page - any help what browser? it scrolls for me in IE8 scroll bar will only appear if it needs to -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "FrontPage Error" <FrontPageError@discussions.microsoft.com> wrote in message news:EC19C7CE-1C5A-4872-A47B-2C04BD7E96A7@microsoft.com... > on microsoft office frontpage 2003 - when i up loaded my web pages to my > web > s...

Plotting data in Excel #2
Is it possible to generate a cell range mathmatically using formulas and "Concatenate" in one reference cell, and then use the contents of the cell to define the data range for an X-Y plot? In other words, instead of manually selecting the data range to be plotted using a pick box, I want the reference the contents of a cell that has computed the data range. Thanks -- James ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message p...

Importing an Excel file into Money
I do my banking with Smith Barney. Although I could download directly into Money (or Quicken) there is a monthly charge to do this. I don't want to use Money or Quicken to pay my bills, simply to organize my finances better. I am able to download my account data into Excel. Is there anyway I can import from Excel into Money? I tried doing this using the import feature, but nothing happened when I selected the Excel file and clicked import (no error messages or anything). In microsoft.public.money, Cruzin wrote: >I do my banking with Smith Barney. Although I could >...

Running Total in report using net of two columns in third column
I have a client time/fees database of over 22k records. I have a report which provided a summary of all time booke and all fees charges to that client. What I require is two additional columns the first which provides a running total of time bookings and the second which provides a running total of the net of the time booked field less the fees charged field, i.e. the net of time bookings which have not been invoiced. I can do this in excel but in access I appear to be getting data from other clients which should not be included in the report. What type of field are you usin...

Importing Tab files
Hello, Here's some odd behavior from Excel. I need to import a tab file with the following two requirements: req 1. Newlines within quotation marks are preserved as part of the record req 2. All fields are imported as text Now, if I do file->open and go through the import wizard, req 2 is met because I can select all fields and set them to text. However, it splits records at newlines within quotation marks no matter what I try. If, on the other hand, I drag and drop the tab file onto Excel, it preserves newlines, but there's no way (as far as I can tell) to force it to input ...

Unable to conect
Hi, I have set up my email account to work with aol using the guidlines for outlook 2002 but it is still unable to connect. Any suggestions? Thanks. John <John@discussions.microsoft.com> wrote: > I have set up my email account to work with aol using the guidlines > for outlook 2002 but it is still unable to connect. Any suggestions? Since you pay AOL for their service, my suggestion is to ask AOL. -- Brian Tillman ...

Populating Excel from CSV
Hello all, I need to know how to populate an Excel template with data from a external CSV file. Let's say I have this nice pretty colourful templat that is far more pleasing to the eye than the usual chunk of importe CSV data, what are some methods to populate it with data from a CS file?? Any ideas or suggestions or redirections would be much appreciated. Thanks in advance : -- AJMorgan59 ----------------------------------------------------------------------- AJMorgan591's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2777 View this thread: http://www.ex...