cancel
Showing results for 
Search instead for 
Did you mean: 

Update period in VBA/VB6

Former Member
0 Kudos

Hi

Im trying to update gl determination from Excel and getting the error 'object doesn't support this property or method' using the following code

Dim oCompanyService As SAPbobsCOM.CompanyService

Dim oPeriodCategoryColl As PeriodCategoryParamsCollection

Dim oPerCategory As PeriodCategory

'get company service

Set oCompanyService = oCmp.GetCompanyService

'get period category Collection

Set oPeriodCategoryColl = oCompanyService.GetPeriods()

'get period category

Set oPerCategory = oCompanyService.GetPeriod(oPeriodCategoryColl.Item(0))

'set the Default sales account

oPerCategory.DefaultSaleAccount = 400010

'update period category

oCompanyService.UpdatePeriod (oPerCategory)

Its the last line that gets the error message

The same code without the 'sets' works in vb 2005 but i need to do it from Excel

Any help gratefully received as i'm losing hair by the handfull

Thanks

Andy McKenny

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andy,

Try to Use

'update finance period

oCompanyService.UpdateFinancePeriod(oFinancePeriod)

Mohamed Zubair

Answers (2)

Answers (2)

Former Member
0 Kudos

Sorted, forgot need call statement in vb6/vba:

Call oCompanyService.UpdatePeriod(oPerCategory)

Andy

Former Member
0 Kudos

Unfortunatey i cant use the FinancePeriod object as it does not countain the gl determination properties as they belong to period category which is the next level up

Regards

Andy