DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel File - Save after Change with Diadem

Hi

i have problems to save my changed Excel File.

Diadem open my Excesheet, bring the "22"in to the Sheet and i close the excel without saving.

I coulnd´t found my mistake and couldn´t found some information on this forum / google / ...

 

 Maybe some one has a idea!

Thanks a lot 🙂

 

 

Option Explicit  'Erzwingt die explizite Deklaration aller Variablen in einem Script.
Dim   ExcelApp, ExcelSheet
Const ExcelMaximized =&HFFFFEFD7

' Start Excel via OLE. -  A new Excel instance always starts.
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible = True                                    ' True = Show ExcelApp. False = Hide ExcelApp.
ExcelApp.WindowState = ExcelMaximized                             ' Maximize Excel window.
ExcelApp.Workbooks.Open("c:\temp\_Test.xlsx")   ' Open prepared DIAdem table in Excel.

Set ExcelSheet = ExcelApp.Sheets("NIO_Files")
ExcelSheet.Cells(2,1).Value = 22 'DemoNumber

'??????????????
ExcelSheet.Parent.Saved = True

ExcelApp.Quit  ' In VBS, Excel must be closed explicitly.
Set ExcelSheet = Nothing 
Set ExcelApp = Nothing

 

 

0 Kudos
Message 1 of 5
(6,148 Views)

New Day - new google - got ist 😛

 

ExcelApp.ActiveWorkbook.Save

 

but i couldn´t find a overview about all the commands you can send to excel.

what helped me was to record a makro an look what happen in excel 😉

 

0 Kudos
Message 2 of 5
(6,133 Views)

Hi MaikThierer,

 

a list of all available commands is only supported by microsoft.

You have to be carefull between available commands "inside" Excel and the available commands published to ActiceX/OLE. There might be a difference.

 

Regards,

 

Philipp K.

AE | NI Germany

0 Kudos
Message 3 of 5
(6,126 Views)

Hi,

 

Need help on a similar situation.

What I want is, after opening an excel through diadem, make changes in it and then save the opened excel as a text file.

 

I modified the script line as given below;

ExcelApp.ActiveWorkbook.SaveAs ("c:\temp\_Test.txt")

 

The script file runs successfully saving the text file and text file opens properly but the data inside is not correct.

 

Does anyone know method to solve this?

 

Regards,

Fazil.

 

 

0 Kudos
Message 4 of 5
(4,423 Views)

 

Got it.

Should modify as given below;

 

ExcelApp.ActiveWorkbook.SaveAs"c:\temp\_Test.txt",20

 

The number 20 is XlFileFormat Enumeration Value for text format (refer: https://msdn.microsoft.com/en-us/library/office/ff198017.aspx)

 

Regards,

Fazil

0 Kudos
Message 5 of 5
(4,417 Views)