Results 1 to 3 of 3
  1. #1
    henry.klassen is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    4

    Imagemagick fails on machine with runtime

    Here's what I got, it runs on the machine with Access installed how ever on the runtime it seems to fail executing the shell command
    Machine 0, Windows 10 Pro Access installed 64 bit executes successful
    Machine 1 Windows Pro, Runtime 2016 64 bit fails to execute
    Machine 2 Windows 10 Pro, Runtime 2016 64 bit fails to execute


    all machine run the same version of imagemagick


    Code:
    Public Function PDFtoBMP(strPart_ID As String)
    Dim ImageMagicPath As String
    Dim StrFileStorage As String
    Dim strPartNumber As String
    Dim strWorkDir As String
    Dim strCadSuffix As String
    Dim iImageQuality As Integer
    Dim strImageFormat As String
    strWorkDir = DLookup("Set_Value", "Settings", "Description = 'Temp_Work_Dir'")
    strPartNumber = DLookup("Part_Number", "Part_Number_tbl", "Part_ID =" & strPart_ID)
    StrFileStorage = DLookup("Image_File_Location", "Customer_Tbl", "Customer_ID =" & DLookup("Customer", "Part_Number_tbl", "Part_Id =" & strPart_ID))
    ImageMagicPath = DLookup("Set_Value", "Settings", "Description = 'Image_Magic_Exe'")
    iImageQuality = DLookup("Set_Value", "Settings", "Description = 'BMP_Quality'")
    strCadSuffix = DLookup("Cad_Suffix", "Customer_Tbl", "Customer_ID =" & DLookup("Customer", "Part_Number_tbl", "Part_Id =" & strPart_ID))
    
    
    
    
    Do
        If FileExists(strWorkDir & strPartNumber & strCadSuffix & ".pdf") = True Then
        Exit Do
        End If
        DoEvents
    Loop
    Shell (ImageMagicPath & "magick.exe " & strWorkDir & strPartNumber & ".pdf " & " -resize " & iImageQuality & "% " & strWorkDir & strPartNumber & strCadSuffix & ".bmp") 'fails to run in runtime
    ' this is what a debug print of the shell string looks like     C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe C:\Work_dir\5-15000.pdf  -resize 30% C:\Work_dir\5-15000.bmp
    Do 
        If FileExists(strWorkDir & strPartNumber & strCadSuffix & ".bmp") = True Or FileExists(strWorkDir & strPartNumber & strCadSuffix & "-0.bmp") = True Then
        Exit Do
        End If
        DoEvents
        Pause (1)
    Loop
    
    
    
    If FileExists(StrFileStorage & strPartNumber & strCadSuffix & ".bmp") = True Then
        SetAttr StrFileStorage & strPartNumber & strCadSuffix & ".bmp", vbNormal
        Kill StrFileStorage & strPartNumber & strCadSuffix & ".bmp"
    End If
    
    If FileExists(strWorkDir & strPartNumber & strCadSuffix & ".bmp") = True Then
    FileCopy strWorkDir & strPartNumber & strCadSuffix & ".bmp", StrFileStorage & strPartNumber & strCadSuffix & ".bmp"
    Exit Function
    End If
    
        If FileExists(strWorkDir & strPartNumber & strCadSuffix & "-0.bmp") = True Then
        FileCopy strWorkDir & strPartNumber & strCadSuffix & "-0.bmp", StrFileStorage & strPartNumber & strCadSuffix & ".bmp"
        Exit Function
        End If
    
        
    
    
    
    
    End Function

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    My first guess would be it's not building the string you think it is when it's attempting to execute the shell command.

    I would have it print the shell command string to a text file (because it's failing on the run time machines this is really your only recourse) to see if it's generating what you think it should be.

    If the string looks good, my second stop would be to verify all the paths/files exist in the folders the string is generating. I've had a few problems in the past where 32/64 bit machines stored things in different locations which would cause a similar type of problem.

  3. #3
    henry.klassen is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    4
    Quote Originally Posted by rpeare View Post
    My first guess would be it's not building the string you think it is when it's attempting to execute the shell command.

    I would have it print the shell command string to a text file (because it's failing on the run time machines this is really your only recourse) to see if it's generating what you think it should be.

    If the string looks good, my second stop would be to verify all the paths/files exist in the folders the string is generating. I've had a few problems in the past where 32/64 bit machines stored things in different locations which would cause a similar type of problem.
    Thank you for responding, what I found to be the problem was the directory had a space in it. The fix was to add qoutes in the string.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Runtime problem on one machine
    By TonyF in forum Access
    Replies: 0
    Last Post: 09-27-2017, 07:08 AM
  2. Can Access 2010 Runtime Run on an XP Machine
    By Dan Hugos in forum Access
    Replies: 4
    Last Post: 03-23-2015, 01:27 PM
  3. Replies: 2
    Last Post: 10-15-2014, 04:23 AM
  4. Runtime 2467 only on a Win 7 Machine
    By ilikebirds in forum Forms
    Replies: 3
    Last Post: 12-11-2012, 03:58 PM
  5. A2007 Runtime on same machine as A2003
    By jhollingsh615 in forum Access
    Replies: 4
    Last Post: 05-24-2011, 12:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums