PabloSan Posted May 4, 2009 Share Posted May 4, 2009 Hello, Has anyone had trouble using the "RUN" command from within VBA? I have just installed v3.3.0.0 from v3.2.1.8. I have VBA code that ran in the previous version that does not run now. Public Sub Test() Dim aiApp as AutoITX3Lib.AutoITX3 Set aiApp = New AutoITX3Lib.AutoITX3 Call aiapp.Run("C:\Apps\GetFileList.exe "C:\TestFolder" "C:\OutputFile.txt","C:\Apps") Call aiapp.Run("C:\Apps\GetFileList.exe "\\Server\Share\TestFolder" "C:\OutputFile.txt","C:\Apps") Set aiApp = Nothing End Sub GetFileList is a program that recursively lists filenames to the "OutputFile.txt" file. I have access and rights to the "\\Server\Share" drive The first Run Command executes fine. The second one puts a 1 in the aiApp.error property. This code has worked fine in v3.2.1.8. Does anyone have any suggestions? Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 5, 2009 Share Posted May 5, 2009 The quotes aren't even, I don't see how it could have ever run. Link to comment Share on other sites More sharing options...
PabloSan Posted May 5, 2009 Author Share Posted May 5, 2009 If it was that simple, I would have found the problem. I just retyped it quick so you could understand easier. It seems that the trouble comes when I try to access a network drive. I can copy the string to a CMD prompt and it runs fine. I just can't run it from inside a VBA program. Has something changed recently with the Run command? SourceFolder=chr$(34) & "\\Server\Share\TestFolder" & chr$(34) OutputFileName="C:\OutputFile.txt" Call aiApp.Run("C:\Apps\GetFileList.exe " & SourceFolder & " " & OutputFileName,"C:\Apps") Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 5, 2009 Share Posted May 5, 2009 The only major change of the dll was that the string handling was changed to unicode. I'm not sure what might have changed, this may be a problem for a developer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now