|
-
Feb 5th, 2005, 03:15 PM
#1
Thread Starter
New Member
VBA Excel and SAP
Hi,
I have a sample VBA code for a connction to Sap usin a macro Excel.
I find this kind of VB Object:
Dim objTable As Object ' Sap Table retrieved
I wish to know more exackty about this object for retrieving field information and filling Excel cells or List Box.
Any help will be well appreciated.
Thanks in advance
-
Feb 5th, 2005, 03:31 PM
#2
Re: VBA Excel and SAP
Welcome to the Forums.
Dim objTable As Object is an example of Late Binding. What it does it decalre a variable as a generic Object.
Then when the code tries to CreateObject as a particular type the system determines if the type is available on
the system. What type of program is SAP? And could you post more code to see if someone could be able
to determine it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 9th, 2005, 07:20 AM
#3
Thread Starter
New Member
Re: VBA Excel and SAP
Hi RobDog888,
and thanks for the reply!
I need to write a macro Excel for receiving info from a SAP Table.
I have this example but I need explanation about the object Table.
More exactly I find the definition of the table
Dim objTable As Object
then a function return a table ...
Set objTable = MyFunction.Tables("TABLE NAME")
where Dim MyFunction as Object
Dim oSapFunctions As Object
Set MyFunction = oSapFunctions.Add("Function Name")
etc ... call the function
Then I found
(case one)
For Each Customer In objTable.Rows
cells(i,1) = Customer("NAME1")
cells(i,2) = Customer("NAME2")
...
i=i+1
Next
(case two)
For longColIndex = 1 to objTable.ColumnCount
msgbox objTable.Columns(longColIndex).ColumnInfo.TypeName
Next
The result of the case two????
I need to store all data of my table, row after row in a strucure type and I'll find a date format. In VB how can I handle this situation avoiding errors in variables with type not correct?
If this SAP Table is considered as a normal table, where can I find methods end attributes? Where can I find a documentation?
Thanks in advance for your kind support.
-
Feb 9th, 2005, 11:50 AM
#4
Re: VBA Excel and SAP
So SAP is some kind of database? If it is then it should have some kind of database or table schema.
Schema is the design and definition of the structure which makes up the table. You may be able to then loop
through the table schema recording its data.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|