Skip to main content

IDEAScript Questions

Open Excel file from IDEA script

I can't get the IDEA script to open a Excel file, i also can't find the answer on Google. Is there anyone with some experience with this?
 
Sub Main
Dim Workbooks As Object
Dim ActiveWorkbook As Object
Dim File As String
File = "H:\!OHW\IDEA\Test Project 01 (9999990)\Import Definitions.ILB\Import definitions.xlsx"
Set Workbooks = CreateObject("Excel.Sheet")
Workbooks.Application.Visible = True
Workbooks.Open (File)
 
'Workbooks.Application.Quit
'Set Workbooks = Nothing
MsgBox "Gereed"
End Sub

Create text file containing field modifications

Hi,
Is it possible to create an IDEA script generating text file in which list down all field modifications and new field creations?
For example, the field "Date" when imported will be renamed to "SaleDate" and this field will be used to create a new field called "FinalDate" later
 

Excel

Is it possible to export multiply IMD files to one Excel files in different worksheet tabs?
And is there a good guide on how to use VBA Excel? I want to add more worksheets tabs and add text to the diffrent worksheet tabs. I got this far with Google:
 
 
Sub Main
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = False
ExcelSheet.Application.Cells(1, 1).Value = "This is column A, row 1"
ExcelSheet.SaveAs "H:\!OHW\IDEA\Test Project 01 (9999990)\Exports.ILB\TEST.xlsx"

Indicex/index

I got a script to create an index, but IDEA don't set the index, the default is no index, is there a way to force IDEA to use a specific index?
 
 
Function IndexDatabase(DatabaseToBeOpened As String, FieldToBeIndexed As String, IndexKey As String)
Set db = Client.OpenDatabase(DatabaseToBeOpened)
Set task = db.Index
task.AddKey FieldToBeIndexed, IndexKey
task.Index FALSE
Client.CloseDatabase(DatabaseToBeOpened)
Set task = Nothing
Set db = Nothing
End Function

Using a global variable defined Macro script 1 and using the same variable value in Macro script2

Hi All & Brian,
I have a doubt regarding declaring a variable in one macro script and then using the variable's value defined by the end user in the first macro in the second macro. To give you more perspective this is the code i am working on:
 
Macro 1: 
Option Explicit
Global sFilename As String

Summarization

Hi, i created a piece of script in which all the parameters are set in the call line. Now i run into the problem that sometimes with the summarization function there a one or more fields to summarize or to total on. I could create an array outside the function and let i unpack within the function with For i to next. But is there a way to create the array within the call line?

Check if field exists

Hi, in the script of generate an audit number is a function to check if the fields exists.
http://ideascripting.com/ideascript/generate-audit-number
I want to use that function to create a indicator if the fields exists (variabele "Result"). To reset it at the start of the script I set it to unkown. I placed a line to set Result to "Exists" afters TempFieldname = sTempFieldname & "1". But i can't find the right place for the line Result = "Not exists".