ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Input Box problem (https://www.excelbanter.com/excel-programming/334296-input-box-problem.html)

Judy Ward

Input Box problem
 
I have an Excel macro that is used to format an Excel spreadsheet. As part
of the macro an InputBox is used to get the date of the next meeting from the
user (and then this date is used to populate one of the columns in the
spreadsheet. This macro works great when run directly.

I want to run this macro from Access (so that the data can be exported and
formatted automatically). When the InputBox pops up and I start to type in
it, this error pops up:
This action cannot be completed because the application() is not responding.
Choose Switch To to activate and correct the problem.

I can click on "Switch To" and continue, but that is not the result that I
want. Is there any way to avoid this error?

Thank you for your help,
Judy

Gary L Brown

Input Box problem
 
Does this Access code snippet help?
'Set a reference to 'Microsoft Excel x.x Object Library'
'/===============================/
Dim XL As Excel.Application
Dim varAnswer As Variant
Set XL = New Excel.Application
varAnswer = _
XL.Application.InputBox("Text Test: ", , , , , , , 2)
Set XL = Nothing
'/===============================/

HTH,
--
Gary Brown

If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".


"Judy Ward" wrote:

I have an Excel macro that is used to format an Excel spreadsheet. As part
of the macro an InputBox is used to get the date of the next meeting from the
user (and then this date is used to populate one of the columns in the
spreadsheet. This macro works great when run directly.

I want to run this macro from Access (so that the data can be exported and
formatted automatically). When the InputBox pops up and I start to type in
it, this error pops up:
This action cannot be completed because the application() is not responding.
Choose Switch To to activate and correct the problem.

I can click on "Switch To" and continue, but that is not the result that I
want. Is there any way to avoid this error?

Thank you for your help,
Judy


Judy Ward

Input Box problem
 
Thank you for responding.

It dawned on my that I could use an Access query parameter to prompt the
user for the date to use. Now the date is already in the spreadsheet and the
macro runs just fine.

Thank you,
Judy

"Gary L Brown" wrote:

Does this Access code snippet help?
'Set a reference to 'Microsoft Excel x.x Object Library'
'/===============================/
Dim XL As Excel.Application
Dim varAnswer As Variant
Set XL = New Excel.Application
varAnswer = _
XL.Application.InputBox("Text Test: ", , , , , , , 2)
Set XL = Nothing
'/===============================/

HTH,
--
Gary Brown

If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".


"Judy Ward" wrote:

I have an Excel macro that is used to format an Excel spreadsheet. As part
of the macro an InputBox is used to get the date of the next meeting from the
user (and then this date is used to populate one of the columns in the
spreadsheet. This macro works great when run directly.

I want to run this macro from Access (so that the data can be exported and
formatted automatically). When the InputBox pops up and I start to type in
it, this error pops up:
This action cannot be completed because the application() is not responding.
Choose Switch To to activate and correct the problem.

I can click on "Switch To" and continue, but that is not the result that I
want. Is there any way to avoid this error?

Thank you for your help,
Judy



All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com