Skip to main content

Hello,

i am currently building a script which should take information and put it into excel, everything works fine until i get to the part where it has to put something into excel and then extract it.

 

the excel part of the script is looking like this:

 

 

'*****************************************************************************************
'indsæt rabat
'*****************************************************************************************
'find ud af hvad der skal gøres med rabat

XLSHeet.Range("V"&3) = Termin1
XLSHeet.Range("V"&5) = Termin2

Rabat = XLSHeet.Range("V"&9)


emsetcursor 22,6
emsendkey Rabat

 

'******************************************************************************************

 

earlier it have worked completely fine but now it constantly crashes, has anyone else had this issue and do you know how to fix this?


#Rumba

Hello,

i am currently building a script which should take information and put it into excel, everything works fine until i get to the part where it has to put something into excel and then extract it.

 

the excel part of the script is looking like this:

 

 

'*****************************************************************************************
'indsæt rabat
'*****************************************************************************************
'find ud af hvad der skal gøres med rabat

XLSHeet.Range("V"&3) = Termin1
XLSHeet.Range("V"&5) = Termin2

Rabat = XLSHeet.Range("V"&9)


emsetcursor 22,6
emsendkey Rabat

 

'******************************************************************************************

 

earlier it have worked completely fine but now it constantly crashes, has anyone else had this issue and do you know how to fix this?


#Rumba
Hi,
can you please describe what exactly is crashing ? Is it the Script Player (vsp.exe) , the excel object or just your script.
What is the exact Error message you get?

Make sure you release the excel object after the work is done.
In order to clean up destroy all objects that refer to objects in the Excel App

- Close all workbooks
- Quit the app

XLSheet.Application.Quit ' Close the EXCEL sheet
Set XLSheet = Nothing ' Release all EXCEL Objects
Set XLBook = Nothing
Set XLApp = Nothing

Hello,

i am currently building a script which should take information and put it into excel, everything works fine until i get to the part where it has to put something into excel and then extract it.

 

the excel part of the script is looking like this:

 

 

'*****************************************************************************************
'indsæt rabat
'*****************************************************************************************
'find ud af hvad der skal gøres med rabat

XLSHeet.Range("V"&3) = Termin1
XLSHeet.Range("V"&5) = Termin2

Rabat = XLSHeet.Range("V"&9)


emsetcursor 22,6
emsendkey Rabat

 

'******************************************************************************************

 

earlier it have worked completely fine but now it constantly crashes, has anyone else had this issue and do you know how to fix this?


#Rumba
Hi besafe,

Script engines in general have a hard time dealing with "Ranges", can you try using Cells instead?

e.g.
MsgBox Sheet1.Cells(1, 1).Value
Sheet1.Cells(2, 1).Value = "Hello World"
Sheet1.Cells(3, 1).Value = 5

Tom

Hello,

i am currently building a script which should take information and put it into excel, everything works fine until i get to the part where it has to put something into excel and then extract it.

 

the excel part of the script is looking like this:

 

 

'*****************************************************************************************
'indsæt rabat
'*****************************************************************************************
'find ud af hvad der skal gøres med rabat

XLSHeet.Range("V"&3) = Termin1
XLSHeet.Range("V"&5) = Termin2

Rabat = XLSHeet.Range("V"&9)


emsetcursor 22,6
emsendkey Rabat

 

'******************************************************************************************

 

earlier it have worked completely fine but now it constantly crashes, has anyone else had this issue and do you know how to fix this?


#Rumba
Hi besafe,

Script engines in general have a hard time dealing with "Ranges", can you try using Cells instead?

e.g.
MsgBox Sheet1.Cells(1, 1).Value
Sheet1.Cells(2, 1).Value = "Hello World"
Sheet1.Cells(3, 1).Value = 5

Tom