Jump to content

Input Box -> Excel


Go to solution Solved by kaisies,

Recommended Posts

Posted (edited)

 
$mynote = GUICtrlRead(InputBox("Special Notes:", "Please type your note:"))
 
 
_Excel_RangeWrite($oWorkBook,"Score", $mynote,"D28",True)

I'm trying to prompt the user to input data onto it then input that data that stored in InputBox to excel spreadsheet on cell D28. I got result as 0 on D28 instead of a message that I type. Any suggestion?

I also tried

$mynote = InputBox("Special Notes:", "Please type your note:")
 
 
_Excel_RangeWrite($oWorkBook,"Score",GUICtrlRead($mynote),"D28",True)
Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
  • Solution
Posted (edited)

Input box returns a string, ctrl read isn't needed. When ctrl read fails, it returns zero. Since you are using it on a string, not a handle, it's functioning normally.

Remove ctrl read and your code will function.

Edited by kaisies
Posted

thanks, I didn't notice it would be that simple.

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...