Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
keithblawrence Absent Member.
Absent Member.
317 views

saving excel workbook to specified file

We usually allow the user to specify the location to save an excel sheet produced from our system. I now want to save the sheet to a specified location/file and exit without a save dialogue box coming up. but cannot seem to get the syntax correct. Can anyone help with this?

0 Likes
2 Replies
RobertRedekop Trusted Contributor.
Trusted Contributor.

RE: saving excel workbook to specified file

Hi. I probably won't be able to help, but those who could will need to know more information:
- how are you creating the excel spreadsheet?
- Are you writing one out directly from cobol?
- Are you using the ole interface somehow?
- Are you making calls to the excel dll? (that one would be my guess)
- how are you currently trying to save the file
0 Likes
jack_magielse Absent Member.
Absent Member.

RE: saving excel workbook to specified file

Try something like this. The displayalerts option to zero suppresses the saveas dialog.

77 OLEXCEL handle of application of excel.

CREATE Application OF Excel
HANDLE IN OLEXCEL.
*This is for training purposes only. If you don't want to see
*Excel, remove this line.
MODIFY OLEXCEL @Visible = 0.
MODIFY OLEXCEL @UserControl = 0.

MODIFY OLEXCEL @DisplayAlerts = 0.
EVALUATE TXT2XLS-FORMAAT
WHEN "TXT"
MODIFY OLEXCEL
ActiveWorkbook::SaveAs(
BY NAME Filename TXT2XLS-SAVEAS-BESTNAAM,
BY NAME FileFormat xlText)
WHEN OTHER
MODIFY OLEXCEL
ActiveWorkbook::SaveAs(
BY NAME Filename TXT2XLS-SAVEAS-BESTNAAM,
BY NAME FileFormat xlNormal)
END-EVALUATE.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.