Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
For aprx. 1 year ago i got help with printing formula. Now I have bought new computers and it don´t work. Do anyone know what could happend? My formula is: Sub menyskrivoffert() ' ' menyskrivoffert Makro UserForm2.Show If canc = 1 Then Exit Sub Sheets("Offert MF").Select Dim str As String Dim strNetworkPrinter As String str = Application.ActivePrinter strNetworkPrinter = GetFullNetworkPrinterName("\\Server\NRG DSc428 Färg") If Len(strNetworkPrinter) 0 Then Application.ActivePrinter = strNetworkPrinter ' change to the network printer ActiveWindow.SelectedSheets.PrintOut Copies:=1 End If Application.ActivePrinter = str Sheets("Meny").Select End Sub Function GetFullNetworkPrinterName(strNetworkPrinterName As String) As String Dim strCurrentPrinterName As String, strTempPrinterName As String, i As Long strCurrentPrinterName = Application.ActivePrinter i = 0 Do While i < 100 strTempPrinterName = strNetworkPrinterName & " på Ne" & Format(i, "00") & ":" On Error Resume Next ' try to change to the network printer Application.ActivePrinter = strTempPrinterName On Error GoTo 0 If Application.ActivePrinter = strTempPrinterName Then GetFullNetworkPrinterName = strTempPrinterName i = 100 ' makes the loop end End If i = i + 1 Loop Application.ActivePrinter = strCurrentPrinterName ' change back to the original printer End Function BR Mia |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mia
Has the printer been installed on the new computer? //Per "Mia" skrev i meddelelsen ... Hello, For aprx. 1 year ago i got help with printing formula. Now I have bought new computers and it don´t work. Do anyone know what could happend? My formula is: Sub menyskrivoffert() ' ' menyskrivoffert Makro UserForm2.Show If canc = 1 Then Exit Sub Sheets("Offert MF").Select Dim str As String Dim strNetworkPrinter As String str = Application.ActivePrinter strNetworkPrinter = GetFullNetworkPrinterName("\\Server\NRG DSc428 Färg") If Len(strNetworkPrinter) 0 Then Application.ActivePrinter = strNetworkPrinter ' change to the network printer ActiveWindow.SelectedSheets.PrintOut Copies:=1 End If Application.ActivePrinter = str Sheets("Meny").Select End Sub Function GetFullNetworkPrinterName(strNetworkPrinterName As String) As String Dim strCurrentPrinterName As String, strTempPrinterName As String, i As Long strCurrentPrinterName = Application.ActivePrinter i = 0 Do While i < 100 strTempPrinterName = strNetworkPrinterName & " på Ne" & Format(i, "00") & ":" On Error Resume Next ' try to change to the network printer Application.ActivePrinter = strTempPrinterName On Error GoTo 0 If Application.ActivePrinter = strTempPrinterName Then GetFullNetworkPrinterName = strTempPrinterName i = 100 ' makes the loop end End If i = i + 1 Loop Application.ActivePrinter = strCurrentPrinterName ' change back to the original printer End Function BR Mia |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Problem | Excel Programming | |||
Formula problem | Excel Worksheet Functions | |||
Formula problem | Excel Worksheet Functions | |||
Formula problem | New Users to Excel | |||
formula problem | Excel Programming |