Printer Detection Macro In VBA
Jun 13, 2009
i have a workbook system that is used on 25 standalone machines that all have different printers everytime i install on a new system i have to reconfigure all of the printers that i have set up in VBA i am curious to find out as to whether or not there is a macro i can use that will generate a list of all printers on a machine that i can then use to refrence a printer name in my VBA
View 3 Replies
ADVERTISEMENT
Mar 16, 2009
i have a macro that loads a userform for previewing and printing selected sheets. The macro works fine for previewing sheets but when i choose the print button the marco trys to save the file as a .mdi, i want this to select the default printer on the pc instead, the excel file will be onpened on many different pcs so the printers will be different on each machine, hence why i want a default printer selected. This is the section of code from the form
View 2 Replies
View Related
Jun 15, 2009
I am trying to swith between different printers to print out sheets within a single workbook. Recording the macro doesn't work very well and the code I found online doesn't work either (error: object doesn't support property).
How can I set this up to be a dynamic printer setting?
Code I tried:
View 2 Replies
View Related
Apr 8, 2009
I want to automate (with the click of a macro button, or hot key sequence) is to:
· take a pre-set print area (which is always the same – 1 page wide x 1 page tall)
· send to the printer
· select the PDF printer from the list (not the default printer for the computer)
· Automatically change the save PDF file name to “(Cell A1) – Weekly Update – (Today’s Date).pdf”
· Change location to save file on Desktop
Feels like a pretty lofty goal for a macro to do all of that – please let me know if that is even possible to set up.
View 9 Replies
View Related
Dec 15, 2008
I have the following code to print a selection of data which is fine but i need to have in the code a different printer. So, for example my default printer needs to stay the same but when this spreadsheet is open i need the data to be printed to another printer.
View 3 Replies
View Related
Dec 6, 2013
Had 2003 now 2013. Trying to get the macro to select different printers for different doccuments. 2013 macro recorder does not record any printer info or path, all printers show the same wording just application print...
How can I get the recorder to acurrately record and diferentiate printers?
View 2 Replies
View Related
Jul 10, 2009
I have built up quite a few macros for automating functions in some spreadsheets, and I want to start being able to detect when errors occur. Right now I just have the function or sub terminate itself if an error occurs, but that just returns control to the calling sub/function.
I need a way to detect if an error occurs, and immedatly terminate the whole process so that it does not continue and make eronious changes further down the line.
I had thought of declaring a pubic boolean variable that i could flip if an error occurs, but I am not sure how to detect this flip without programing in an if statement every time i call a function.
Question1: Is there a way to write a function/sub that will automaticly triger if a public variable becomes a certain value?
Question2: How do I unload a macro (terminate it) from a public function? I have found that for user forms, the Unload Me command does not work in a public function. I suspect this is becasue the function is not directly attached to a form.
View 9 Replies
View Related
Aug 7, 2007
I have a spreadsheet that grows rapidly each day of addresses I service. Duplicates are not welcome. When the spreadsheet was smaller, I would type in an address and if it was a duplicate, Excel would auto fill the cell with the duplicate data. Now that the rows are over 2000, I wanted to see if this primitive method for weeding out duplicates was still working, however when I type the first address I have in cell A1, it does not auto fill in A2001, even though it is a duplicate.
Is there any way to have on-the-spot detection of duplicates sans macro?
View 9 Replies
View Related
May 19, 2006
The code in the file works but, I wonder if you could comment and suggest an improvement to the code in the attached file. With the generous help of good folks on this site, I have developed a code to use in my workbook (a sample is attached). Before I use it I would like to be sure that it will not generate any errors.
View 3 Replies
View Related
Feb 27, 2014
I have an array and I need to be able to detect when a varying number of consecutive array elements are equal. I want to be able to call the code and give the number of elements I need to find.
The following does not work but illustrate what I am looking for.
[Code] .....
I have been looking at ways of recording the number of equalities in the p loop, but I am sure there is a more elegant way.
View 2 Replies
View Related
Mar 12, 2009
Background: I have 3 lists. List 1 is a column of unique identifiers. List 2 is a column of unique identifiers. List three is supposed to contain as many rows as the number of rows in List 1 * the number of rows in List 2. Each row in List three has as its unique identifier a value from List 1 concatenated with a value from List 2.
What my problem is: I want to determine, when looking at each row in list 1, if there is an corresponding entry in list 3 for every row in list 2.
View 10 Replies
View Related
Jun 6, 2007
I want the user to be able to choose a printer but not print at that time.
1. Store the active printer as a variable using application.activeprinter
2. Have a dialog box (the printers available) popup and have them choose one, then store that
3. I know how to do the rest, but I will have the word document print out with the selected printer, then use the application.activeprinter reset to the original one
View 9 Replies
View Related
Oct 16, 2007
Is there a way to set the printer's properties using VBA?
Sometimes we set the printer for BEST quality to do photos or brochures. Well if we don't change it back, when we go to print a spreadsheet, it takes forever because it is set on best quality.
So......
I want to be able to set the print properties to normal using VBA.
View 9 Replies
View Related
Sep 30, 2008
I need an assistance in setting up a VBA for the default printer in my office. The issue is I want my spreadsheet to be set up to wherever I open the spreadsheet at any computers in the facility. I want the sheet to be printing out directly at the printer in my office only. Is there a way to do this?
View 9 Replies
View Related
Jan 12, 2009
I have a form that all the salespeople use. The last thing in the process is to print the completed form to a specific printer. I recorded a macro to get the proper name of the printer but I am finding out that it records differently for each computer. Is there a way around this?
View 9 Replies
View Related
Nov 23, 2006
I have a quality form that is produced from data on an Excel log file. I was wondering if it is possible to select a different network printer based upon the value of a certain cell.
I understand how to print using the local machines local printer but our quality department is located at one site and these forms need to be printed at our other locations.
View 3 Replies
View Related
Jun 5, 2014
I have a spreadsheet where I am trying to print barcode labels. The barcode is found in cell A1. I have looked in a lot of places and I can't really figure out exactly how to do it. This is the code that I have so far but it gives me an error. The printer name should be right. Some of this code I just copied from another thread.
[Code].....
View 4 Replies
View Related
Feb 5, 2009
how to automate the printing of Excel sheets each with a different name to a Cute pdf printer?
I have a VBA procedure which uses Windows API calls to write to a system ini file (which I understand is a necessary requirement of the Cute software), which loops through all the sheets I need to print, and sends them one by one to a Cute pdf printer. However each time the 'print' instruction is invoked - I say print but of course this is really a file save process, the Save As dialog box pops up asking the user to confirm the save.
What I want to achieve is the file gets saved automatically, with the relevant sheet name with no confimation dialog box.
View 9 Replies
View Related
May 17, 2009
I have got a buttion that changes various layout and borders for the page then shows a printpreview, after printprewiew closes.
Then a msgbox that askes if you would like print. Is there a way to change the defult printer between local printer and adobe distiller(.pdf) as a dropdown option box. Or Yes for Local printer and NO for adobe distiller(.pdf) using vbYesNoCancle.
View 9 Replies
View Related
Jan 2, 2007
I have a file for which I wish only selected pages to be printed, so I have disabled the print function in the ThisWorkbook module. Instead, the user chooses from a menu of available sheets to print, via a user form, and then requests the print.
I've got most of this sussed in my mind, but the users need the option of which printer to use (loads of networked printers available and the choice will depend upon monochrome for draft print or full colour for final print), so I want to be able to call up the printer dialog box using
Application.Dialogs(xlDialogPrint).Show
BUT!!!!
I want all the options on the dialog box disabled, except for the choice of printer as clicking OK after choosing the printer adds the active sheet to the list of items to print.
View 2 Replies
View Related
Jun 16, 2007
In my program I want some labels to be printed on printer P661 (black/white) and other labels on printer P656 (color).
Q: is it possible to do this in vba for my code?
The labels are made in Word and printed from within Excel.
Sub PrintNACL_LABEL()
Dim oWord As Object
Dim sPath As String
Dim iCnt As Integer
sPath = ThisWorkbook.Path & Application.PathSeparator & "NACL_LABEL.doc"
iCnt = Val(InputBox("Hoeveel exemplaren?", "NACL_LABEL", 1))
If iCnt >= 1 Then
Set oWord = CreateObject(Class:="Word.Application")
With oWord.Documents.Open(sPath)
.PrintOut Background:=False, Copies:=iCnt
.Close False
End With
oWord.Quit False
End If
Set oWord = Nothing
End Sub
The specific printers in the network are:
Color ---> "\PlantijnP656 op Ne00:"
Black/white ---> "\plantijn2000oldP661 op Ne02:"
View 9 Replies
View Related
Nov 22, 2007
i am using windows xp, and i am printing from a matrix printer, so i go to file then print then on the top right of the dialog box it say properties, and i go there to change the printers speed and darkness, the i click ok to print.
View 9 Replies
View Related
Oct 30, 2008
Is there a way to test for an active default network printer?
In my module the code sets the paper size and a few other printer settings, if my default network printer is down or offline the code fails.
If I could test for active default printer I could remove this error.
View 9 Replies
View Related
Mar 5, 2009
I have excel printing some sheets to pdf and it works fine on my PC. WHen someone else tries to print it wont work because they arent on "Adobe PDF on Ne02:"...they maybe on Ne03 or Ne08 or ne05...you get my point.
I saw code on here before as to how to find the proper "port" but after a bit of searching, i cant find it again.
Application.ActivePrinter = "Adobe PDF on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF on Ne02:"
View 9 Replies
View Related
Apr 14, 2009
I have a workbook with 150-some-odd sheets, each with a store number. I would like to loop through each sheet & print that sheet to the printer with the same name in my printers & faxes queue.
(eg. sheet 9604 would print to printer name oki9604)
View 9 Replies
View Related
Sep 30, 2004
how to identify in code which installed printer is set as the default printer? I can set/switch printers easily enough but don't seem to be able to identify the default printer as opposed to the active printer...
View 6 Replies
View Related
Jun 2, 2006
I'm trying to save excel files as pdf using vba code and the cutepdf printer. If I do this manually it works, but when I write code it saves the output to a file that cannot be read or opened
Unfortunately I don't have access to the pdfdistiller so can't use this technique which I've seen described in a number of forums.
The code I've used is below.
[PHP]Sub pdfing()
Dim cntTrue As Long, cnt As Long
Dim rng As Range, bk As Workbook
Dim fName As String
Dim WB As Workbook
Dim FundName As String
Workbooks.Open ("S:SRQFSFCWNames")
Range("A1").Select
Do
FundName = ActiveCell.Value
fName = Dir("S:SRQFS" & FundName & ".xls")
Do While fName <> ""
Workbooks.Open ("S:SRQFS" & fName), UpdateLinks:=0
cnt = cnt + 1
fName = Dir()
Application. ScreenUpdating = False
Loop
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
Range("A3:X3").Select
ActiveWorkbook.Save
View 4 Replies
View Related
Jul 26, 2007
I have a new workbook that needs to be printed to a specific printer regardless of who the user is. I am happy with the method used for doing this using the PrintOut function, but am trying to work out what to do in the event that the user does not have this printer installed. The logic, not in true VBA syntax, is as follows;
' Check Printer
If <This Printer> Is installed Then
Printout using <This Printer>
Else
Install <This Printer>
Printout using <This Printer>
I found a useful post about ascertaining whether or not a printer is installed, but can't find anything about actually installing a printer via VBA.
View 7 Replies
View Related
Mar 30, 2009
Is if possible to set up two different sheets in the same workbook to print as front and back pages on a duplex printer?
View 7 Replies
View Related
Feb 17, 2009
Is there a Macro to automatically print the selected print area (print area is also established within the macro itself) to a user's default printer; whatever that printer may be? Note that this printer and/or printer name could change depending on the user.
I would like this to actually select and print to the default printer without Excel having to ask you. I don't even want the "OK" box to show up if possible. I just want them to run the macro, execute all it's duties, and print, all in 1 shot.
View 3 Replies
View Related