Hey Guys,
I bet there are lots of experts here.
I am about to ask a question that I am not eve sure if it's related to VB. I hope so.
We have a macro that reads, from a Excel spreadsheet, some data and write them in another application.
I have never changed the code and it used to work fine.
Since a time ago, when I try to run it, I get an error message saying: "Execution Time Error 5" and then one line of the code gets yellow.
The yellow line is: AppActivate ReturnValue
And the code from top until the error is found follows below.
Can you by the code below help me out and tell me what's wrong and WHY it's not working now since I haven't made any amendments to it...
I am a complete DUMB regarding VB (hope the code is in VB).
Thanks a lot in avance!
Fabio
Option Compare Database
Option Explicit
Sub CreateDiccionario()
Dim ReturnValue, I
Dim wrk As Workspace
Dim db As Database
Dim TDict As Recordset
Dim PrimeraVar As Boolean
'Open the workspace, the database and the table with the information about the
'characteristics
Set wrk = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrk.OpenDatabase("C:\WINNT\Profiles\Administrator\Desktop\macro.mdb"
Set TDict = db.OpenRecordset("SPC", dbOpenSnapshot) 'HERE
'Run Dictionary
ReturnValue = Shell("c:\ccnprod\system\global\dict32.exe", vbNormalFocus)
'Activate Dictionary
AppActivate ReturnValue
'file open; lost time while wait the dictionary is active
SendKeys "superuser{TAB}mega{TAB 2}{ENTER}", True
For I = 1 To 250
SendKeys "%(f)o"
Next I
....code continues
I bet there are lots of experts here.
I am about to ask a question that I am not eve sure if it's related to VB. I hope so.
We have a macro that reads, from a Excel spreadsheet, some data and write them in another application.
I have never changed the code and it used to work fine.
Since a time ago, when I try to run it, I get an error message saying: "Execution Time Error 5" and then one line of the code gets yellow.
The yellow line is: AppActivate ReturnValue
And the code from top until the error is found follows below.
Can you by the code below help me out and tell me what's wrong and WHY it's not working now since I haven't made any amendments to it...
I am a complete DUMB regarding VB (hope the code is in VB).
Thanks a lot in avance!
Fabio
Option Compare Database
Option Explicit
Sub CreateDiccionario()
Dim ReturnValue, I
Dim wrk As Workspace
Dim db As Database
Dim TDict As Recordset
Dim PrimeraVar As Boolean
'Open the workspace, the database and the table with the information about the
'characteristics
Set wrk = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrk.OpenDatabase("C:\WINNT\Profiles\Administrator\Desktop\macro.mdb"
Set TDict = db.OpenRecordset("SPC", dbOpenSnapshot) 'HERE
'Run Dictionary
ReturnValue = Shell("c:\ccnprod\system\global\dict32.exe", vbNormalFocus)
'Activate Dictionary
AppActivate ReturnValue
'file open; lost time while wait the dictionary is active
SendKeys "superuser{TAB}mega{TAB 2}{ENTER}", True
For I = 1 To 250
SendKeys "%(f)o"
Next I
....code continues