ShellExecute -- Printing Error -- Memory Problem ?

We are having a problem printing a certain document from Excel when it is shelled from VB6 (most documents print fine). If we run Excel and load the file separately, it prints fine (using Black Ice ColorPlus printer driver). However, launching Excel via ShellExecute causes an error. We aren't sure what is causing it, but the only thing that seems different is that it is run in a shell. It normally works fine, but could this be causing problems?

Function StartDoc(DocName As String) As Long
   Dim Scr_hDC As Long
   Scr_hDC = GetDesktopWindow()
   StartDoc = ShellExecute(Scr_hDC, "Open", DocName, "", "C:\", SW_SHOWNORMAL)
   ....


p.s., first part of error message:

Your file could not be printed due to an error on Black Ice ColorPlus on IcePortAD:. There are several possible reasons:
....
LVL 9
GivenRandyAsked:
Who is Participating?
 
vinnyd79Commented:
Do you get the error if you call it like this?

Function StartDoc(DocName As String) As Long
   Dim Scr_hDC As Long
   Scr_hDC = GetDesktopWindow()
   StartDoc = ShellExecute(0, "Open", DocName, "", "", SW_SHOWNORMAL)
0
 
GivenRandyAuthor Commented:
Turns out that their latest driver fixes up. Time for an upgrade!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.