johnisotank
Technical User
Hi all, desperately need some help for this please. I have an Excel macro which has been running on my XP machine fine for years. I have now switched to Windows 7 and the SendKeys function no longer works properly. I need a workaround please.
The code is supposed to 1. Send a print of my current sheet to the CutePDF Writer, 2. Change the location of where to save the file, 3. Press enter on the dialog box to print the file
Code is
All that happens now (with Win7) is the print command gets actioned and the CutePDF Writer dialog box opens asking where to save the PDF. Steps 2 and 3 just dont happen. Any advice is really appreciated.
Thanks
John
The code is supposed to 1. Send a print of my current sheet to the CutePDF Writer, 2. Change the location of where to save the file, 3. Press enter on the dialog box to print the file
Code is
Code:
Workbooks("Manpack Depot Reporter.xls").Activate
'Print to CutePDF
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"CutePDF Writer on CPW2:", Collate:=True
' Pause for x seconds
Pause (5)
' This line of code sends the filename characters and the ENTER key to the active application (i.e. the prompt window). The "False" statement allows the macro to continue running without waiting for the keys to be processed.
SendKeys "\\128.128.128.12\SharedDocs\ICT\Software\Manpack Scheduled Reports\Temp"
SendKeys "{ENTER}"
All that happens now (with Win7) is the print command gets actioned and the CutePDF Writer dialog box opens asking where to save the PDF. Steps 2 and 3 just dont happen. Any advice is really appreciated.
Thanks
John