Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Diana96 pe Simpatie.ro
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 50 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] VBA That Extracts Total Value from SAP Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 739
The code from source is easily adapted.

The problem in my case was converting the value from SAP table to Excel formatted number, with . as thousands separator and , as decimals separator. SAP, in my case, has the exact separators I need, however importing the value in Excel either created a value stored as text, or removed the , decimal separator altogether and resulted in a number 1000 times bigger.

The solution was to properly declare a variable and store the .getCellValue result in it. The format it should be declared as is Double (since Integer obviously removes decimals, and Long apparently also removes decimals). Not declaring at all - which I did in the first place - stored the value as String.


Dim tbl As Object
Dim tmp_value as Double
Set tbl = SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")
tmp_value = tbl.getCellValue(.RowCount - 1, "ERFMG")
ActiveCell.Value = tmp_value


Source:
Post from source:


pus acum 3 luni
   
Pagini: 1  

Mergi la