Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search for excel sheet in 3DExperience Database using VBA?

Status
Not open for further replies.

22555

Automotive
Joined
Dec 17, 2003
Messages
24
Location
US
Hello ,

Currently I am working on a product template in 3DExperience which has Design Table. Associated excel sheet is saved in 3DX database.

Trying to create a macro to do the following task.

Open the excel sheet associated with Design table which is saved in 3DExperience database ----> Check out -----> Update the values in excel -----> Save and Check in.

In VBA below code is not working
Dim oDBSearch As DatabaseSearch
Set oDBSearch = oSearchService.DatabaseSearch
oDBSearch.BaseType = "Document"

oDBSearch.AddEasyCriteria "PLM_ExternalID", "XXXXX"

Dim oEntity 'As PLMEntity
'Set oEntity = oDBSearch.Results.Item(1)

I also tried this in EKL function, Problem is 1. Design table association is broken after running . 2.if excel sheet has 2 sheets. I could not access second sheet to update the value. Or how to do that?

Thanks in Advance
22555

***************EKL********************
let doc (PLMDMTDocument)
let query (PLMQuery)
let results (List)
let result (PLMQueryResult)
let str1(String)

query = CreatePLMQuery("PLMDMTDocument")
query->AddCriterion("PLM_ExternalID","XXXXXXXX")
results = query->RunQuery()
str1 = "Test"
if (results.Size() == 1)
{
set result = results[1]
let path (String)
set doc = result->LoadResult()
path = doc->CheckOut()
Path = path
Message(path)
let sh (DTSheetType)
sh = CreateSheet(path, "")
sh->SetCell(1, 1, "My val without read cell")
sh->CommitChanges()
doc->CheckIn(path)
PopupMessage("This instance is : ", str1)
}
else
Message("result not found")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top