Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Wanted: Syntax for Filename changed without impacting Macro

Hello,
I have the following line of code that was created by the macro
recorder:

Application.Run "CHFSform98g2.xls!S6Exp"

This runs a macro in the current spreadsheet called S6Exp. My dilema
is that the name of the spreadsheet (CHFSform98g2) changes, creating an
error in the macro. Is there a good syntax that will run S6Exp
regardless of the filename?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Wanted: Syntax for Filename changed without impacting Macro

I guess with the holidays my mind is somewhere else; perhaps in a
sugar-buzz haze.....

I used the CALL command:
CALL S6Exp
and that worked! Merry Christmas everyone!
-- A

Jim Jackson wrote:
You should be able to change the line to Application.Run "S6Exp" and have
it work.
--
Best wishes,

Jim


"bluegrassstateworker" wrote:

Hello,
I have the following line of code that was created by the macro
recorder:

Application.Run "CHFSform98g2.xls!S6Exp"

This runs a macro in the current spreadsheet called S6Exp. My dilema
is that the name of the spreadsheet (CHFSform98g2) changes, creating an
error in the macro. Is there a good syntax that will run S6Exp
regardless of the filename?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wanted: Syntax for Filename changed without impacting Macro

Is S6Exp a procedure in the same workbook's project?

If yes:
call S6Exp



bluegrassstateworker wrote:

Hello,
I have the following line of code that was created by the macro
recorder:

Application.Run "CHFSform98g2.xls!S6Exp"

This runs a macro in the current spreadsheet called S6Exp. My dilema
is that the name of the spreadsheet (CHFSform98g2) changes, creating an
error in the macro. Is there a good syntax that will run S6Exp
regardless of the filename?

Thanks


--

Dave Peterson
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
Impacting a cell Erol Excel Discussion (Misc queries) 4 May 5th 09 02:56 PM
Insert a filename that will automatically update if changed. JR Excel Worksheet Functions 1 November 17th 08 02:48 PM
I wanted Excel's appearence changed to Olive green jjtools New Users to Excel 4 January 11th 08 02:34 AM
syntax for filename:= jhahes[_37_] Excel Programming 1 October 5th 05 06:23 PM
VBA - Syntax filename rangename for vlookup formula Thomas[_18_] Excel Programming 4 December 3rd 04 01:42 AM


All times are GMT +1. The time now is 07:35 AM.

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"