+ Reply to Thread
Results 1 to 5 of 5

Problem using shell32.dll in VBA

  1. #1
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    Problem using shell32.dll in VBA

    I'm having problems with the below code.
    I have incorporated it into the Code Window commandbar which simply calls PrintProcedure.
    The call is working fine, it's just that whenever I right click over a VBA procedure I want to print and select the "Print this procedure" entry (which calls PrintProcedure), Notepad opens up and always complains:
    Cannot find the [full path and filename] file. Do you want to create a new file?
    However, if I set a break point in PrintProcedure, call it as above and then step through it I don't get the complaint. Can anyone suggest what I'm doing wrong?
    Please Login or Register  to view this content.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Problem using shell32.dll in VBA

    assuming that you do have a text file named .....
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Problem using shell32.dll in VBA

    ops... reading the code better change "input" to "output"
    still have to all ready have the file created that what the orgonial code was looking for
    and this
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    Re: Problem using shell32.dll in VBA

    Pike, there is nothing unexpected appearing in the Immediate Window. As I said, if I step through (F8) the proc then everything works fine. It's only when I call it without slowing it down (via using F8), does it produce the error I previously mentioned.

    It seems to be the last line: Kill(strPath)
    If I remove that line, I don't experience any problems.
    What's the best way of deleting the text file after it's printed?
    Last edited by PingPing; 05-14-2010 at 06:04 AM.

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Problem using shell32.dll in VBA

    oh..
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1