Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default I need to avaoid an Excel prompt.

Hello,

I have the following code in a macro to setup a series of formulas in a
sheet. Trouble is, when run, Excel prompts for me to select the file from a
list. I don't think I should need to select it as I am being specific about
the path and filename in the code.

ActiveCell.Offset(0, 0).Formula = pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value

(ActiveCell.Offset(0, 12).Value adds a range name to the formula)

Any ideas anyone?

Thanks

Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default I need to avaoid an Excel prompt.

hi
trying putting this just before the filepath line...
Application.DisplayAlerts = False
be sure to turn alerts back on BEFORE exiting the sub
Application.DisplayAlerts = True

regards
FSt1

"Richard M Burton" wrote:

Hello,

I have the following code in a macro to setup a series of formulas in a
sheet. Trouble is, when run, Excel prompts for me to select the file from a
list. I don't think I should need to select it as I am being specific about
the path and filename in the code.

ActiveCell.Offset(0, 0).Formula = pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value

(ActiveCell.Offset(0, 12).Value adds a range name to the formula)

Any ideas anyone?

Thanks

Richard

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default I need to avaoid an Excel prompt.

Richard,

It seems you're missing an equal sign and a single quote character to
precede the pathname. Try it this way:


ActiveCell.Formula = "='" & pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value


--
Hope that helps.

Vergel Adriano


"Richard M Burton" wrote:

Hello,

I have the following code in a macro to setup a series of formulas in a
sheet. Trouble is, when run, Excel prompts for me to select the file from a
list. I don't think I should need to select it as I am being specific about
the path and filename in the code.

ActiveCell.Offset(0, 0).Formula = pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value

(ActiveCell.Offset(0, 12).Value adds a range name to the formula)

Any ideas anyone?

Thanks

Richard

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default I need to avaoid an Excel prompt.

Thanks FSt1,

This certainly helped.

After I ran the macro I needed to update the links and this seems to have
sorted it.....after some further tweaking.

Regards

Richard

"FSt1" wrote:

hi
trying putting this just before the filepath line...
Application.DisplayAlerts = False
be sure to turn alerts back on BEFORE exiting the sub
Application.DisplayAlerts = True

regards
FSt1

"Richard M Burton" wrote:

Hello,

I have the following code in a macro to setup a series of formulas in a
sheet. Trouble is, when run, Excel prompts for me to select the file from a
list. I don't think I should need to select it as I am being specific about
the path and filename in the code.

ActiveCell.Offset(0, 0).Formula = pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value

(ActiveCell.Offset(0, 12).Value adds a range name to the formula)

Any ideas anyone?

Thanks

Richard

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default I need to avaoid an Excel prompt.

Thanks for the reply Vergel.

This was not the problem as the =' was included elsewhere, but I certianly
did not help myself by using Pathname as a variable!

Thanks again

Richard

"Vergel Adriano" wrote:

Richard,

It seems you're missing an equal sign and a single quote character to
precede the pathname. Try it this way:


ActiveCell.Formula = "='" & pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value


--
Hope that helps.

Vergel Adriano


"Richard M Burton" wrote:

Hello,

I have the following code in a macro to setup a series of formulas in a
sheet. Trouble is, when run, Excel prompts for me to select the file from a
list. I don't think I should need to select it as I am being specific about
the path and filename in the code.

ActiveCell.Offset(0, 0).Formula = pathname &
Worksheets("variance").Range("I1").Value & ".xls'!" & ActiveCell.Offset(0,
12).Value

(ActiveCell.Offset(0, 12).Value adds a range name to the formula)

Any ideas anyone?

Thanks

Richard

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete cell shifts cells up - How to avaoid happening user2616 Excel Discussion (Misc queries) 0 October 23rd 07 06:51 PM
Excel save prompt R Ormerod Excel Discussion (Misc queries) 6 September 10th 07 04:22 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Excel add-in password prompt and Act! Bob Flanagan Excel Programming 0 August 12th 05 09:03 PM
How do program a prompt in excel 97? Doug Glancy Excel Programming 1 September 3rd 04 08:08 PM


All times are GMT +1. The time now is 04:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"