DATA Step, Macro, Functions and more

Error when writing data to Excel using the Excel libname engine

Reply
Occasional Contributor
Posts: 8

Error when writing data to Excel using the Excel libname engine

Hi,

I need to update an Excel spreadsheet in situ and would like to avoid using DDE so I want to use the Excel libname engine and get errors like the following:

ERROR: Bind parameters: Invalid column name: Name

This is when I try writing to the file using a data step. Can anyone tell me how to avoid this error when using the Excel LIBNAME engine to write out the data or what it means so I can take things further myself?

Thanks in advance,

John

Super User
Posts: 7,808

Re: Error when writing data to Excel using the Excel libname engine

Look at this:

16842 - Writing SAS Variable Labels that Contain Dots to Excel Field/ColumnNames

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 8

Re: Error when writing data to Excel using the Excel libname engine

Posted in reply to KurtBremser

Hi Kurt,

I have seen this already but my variable names or labels do not contain any dots so I am sure that it helps.

Thanks anyway,

John

Super User
Posts: 7,808

Re: Error when writing data to Excel using the Excel libname engine

Hmm. All references to this error message point to variable names and labels.

So I'd try to get all names and labels to conform to validvarname=v7 (alphabetic characters, digits and underline) and start from there.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 8

Re: Error when writing data to Excel using the Excel libname engine

Posted in reply to KurtBremser

Hi Kurt,

After another look, I think that I have it sorted. Foolishly, I left a header=no option in the libname statement from an original that I had copied and amended. That appears to have triggered the message and removing it helped. In case anyone else has the same problem, I am sharing this here for reference.

Thanks for your time,

John

Super User
Posts: 7,808

Re: Error when writing data to Excel using the Excel libname engine

SAS: a myriad ways to try doing things the wrong way.

Smiley Happy

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 5 replies
  • 264 views
  • 0 likes
  • 2 in conversation