Hi everybody
I am using some VBA to open a template with diagramm and graphics in Excel and I fill it with results of a workbook. In 3.5 everything was running nicely. In 7.0 there are/were some troubles.
<b>Old code:</b>
Const WBID_TEMPLATE As String = "CQ00SA3O0OIMA70BN1HOPO6A7"
Dim sWbTemplate As String
...
sWbTemplate = Run("SAPBEX.XLA!SAPBEXreadWorkbook", WBID_TEMPLATE)
...
this code is not working under 7.0 anymore. So after reading through SDN I took away the SAPBEX.XLA which is public now and does not need to be called anymore. This worked without error message but it also did not give any value back. sWBTemplate is always empty.
I solved the problem by adding a code line and reading the name of the active Workbook in the variable and this even works. But I still don't understand why I don't get a value back right away. Can somebody explain this behaviour to me?
<b>new code:</b>
Const WBID_TEMPLATE As String = "CQ00SA3O0OIMA70BN1HOPO6A7"
Dim sWbTemplate As String
...
sWbTemplate = Run("SAPBEXreadWorkbook", WBID_TEMPLATE)
sWBTemplate = ActiveWorkbook.Name
...
Any ideas, comments?
thanks!
christophe