Skip to content

How to pass a string with value "default" as a parameter? #142

Description

@pillowfication

Whenever I try to pass a value of "default" into a function, it seems to get ignored.

const winax = require('winax')
const excel = new winax.Object('Excel.Application', { activate: true })

excel.Workbooks.Add()
excel.Workbooks.Item(1).SaveAs('default')
// Instead of saving as "default.xlsx", it saves as the default name of "Book1.xlsx"
// as if `.SaveAs()` was called without parameters.

excel.Workbooks.Add()
excel.Workbooks.Item(2).SaveAs('asdf')
// This saves as "asdf.xlsx" as expected

I've tried the following:

workbook.SaveAs('default')

workbook.SaveAs(new winax.Variant('default', 'string'))

workbook.SaveAs(winax.cast('default', 'string'))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions