Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3316

Re: Export pdf using Windows window

$
0
0

Hi everybody,

 

sorry for not answering sooner.

 

The code works.

I had the same problem as you --> it's because you must not start the code in the editor but from Excel or that like. If you start the code from the editor,  'AppActivate' activates the Window for one second and jumps back to the editor in order to execute the next line. If you start the code from somewhere else (not in the editor) you won't have such issues

 

I've improved the code a little bit: (not the codes waits until the window "SaveAs" (Speichern Unter) is opened

 

      Set WshShell = CreateObject("WScript.Shell")

      Do

      On Error Resume Next

      AppActivate "SaveAs"

      Loop Until Err.Number = 0

      AppActivate "Speichern unter"

      WshShell.SendKeys "%n"

      WshShell.SendKeys strFilename

      WshShell.SendKeys "%s"

 

 

 

I look for a code sending the parts without activating the window (i.e. in the background) but that takes a while

 

thanks

br

Michael


Viewing all articles
Browse latest Browse all 3316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>