473,378 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Invalid procedure call or agrument

489 256MB
Here's the statement that is causing this error
Expand|Select|Wrap|Line Numbers
  1. set Application.printer = Application.Printers("" & labPrt & ""
Where labPrt = "\\xpserver\Lab" This is a printer on the xpserver. If I comment out this statement and make the lab printer the default printer the report prints just fine.
it seems like this was working and now it isn't. I've checked to see if any references were missing but everything look good. Any help would be appreciated.
Thanks
Oct 9 '15 #1

✓ answered by zmbd

+ are you missing the closing parentheses " ) " in the actual code or is that a typo?

Also if labPrt is Dim as String and set to a valid application printer object then you don't need to use quotes
Expand|Select|Wrap|Line Numbers
  1. ...air...
  2.    DIM labPrt as String
  3. '
  4. '...
  5.    labPrt = "\\xpserver\Lab"
  6. '
  7.    set Application.printer = _ 
  8.    Application.Printers(labPrt)
+ What is the exact number and description text of the error?

+ Have you set option explicit and debug>compiled the code?

1 1517
zmbd
5,501 Expert Mod 4TB
+ are you missing the closing parentheses " ) " in the actual code or is that a typo?

Also if labPrt is Dim as String and set to a valid application printer object then you don't need to use quotes
Expand|Select|Wrap|Line Numbers
  1. ...air...
  2.    DIM labPrt as String
  3. '
  4. '...
  5.    labPrt = "\\xpserver\Lab"
  6. '
  7.    set Application.printer = _ 
  8.    Application.Printers(labPrt)
+ What is the exact number and description text of the error?

+ Have you set option explicit and debug>compiled the code?
Dec 5 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: john | last post by:
Ran Windows update tonight. Since then I get this error: HTTP 500.100 - Internal Server Error - ASP error Internet Information Services ...
6
by: mork | last post by:
I am so frustrated - any help is appreciated. When trying to use common functions like Left and/or Mid I get the following error: Run-time Error '5': Invalid Procedure Call or Argument In my...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
2
by: Zoury | last post by:
Hi there! I'm using a COM component from my C# application and I can't get it to work properly. I get a COMException (Invalid procedure call or argument) on this line : //***...
1
by: Terry | last post by:
Hi. We had a in-house program that use a PRINTLBL.EXE to print label in DOS mode. after the label was printed, Window XP will issue the error message ( Invalid procedure call or arguments ). But if...
5
by: Matt | last post by:
I am receiving the following error from the simple script below. This works fine from a .NET form but when I access the dll from a Classic ASP page it fails. Microsoft VBScript runtime error...
5
by: Eric | last post by:
I run a program which read emails from a text file. There is some thing invalid in one or more text file. When program is busy doing parsing it shows that error and process stop. I dont know which...
0
by: AparnaKulkarni | last post by:
Hello, I m working with Templates in MS Word. I have established the user Template locations in Word with ".dot" file But after that I m getting error as "Invalid procedure call or argument...
6
by: HaggardSmurf | last post by:
Private Sub Downloader1_DownloadComplete(MaxBytes As Long, SaveFile As String) If MsgBox("Donwnload Finished. Would you like to install now?", vbInformation + vbYesNo, "Blue Cherry Media...
1
by: PurpleWitch | last post by:
Hi there I'm using an Access 2000 DB on Office 2000. The following Pivot Table worked fine 2 days ago, but no I'm getting the "Invalid Procedure Call or Argument" error when using Pivot Table...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.