Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Fred
 
Posts: n/a
Default embedding a macro when generating a CSV file

Greetings!

I have a recorded macro for a chart of data in an excel file.
Now the question is - how does one generate a CSV file with
that macro embedded to generate this chart dynamically.

The CSV file will be generated by a user with a series of
data (columns/rows). The macro is consistent in that it
will generate a chart based upon the SAME column/rows.
The difference is that the values will be in flux.

Generating the CSV file with the data isn't the problem.
How do you then embed the macro code to generate the chart
(for each file being created).

Regards,

Fred

  #2   Report Post  
Posted to microsoft.public.excel.charting
Tushar Mehta
 
Posts: n/a
Default embedding a macro when generating a CSV file

You cannot have a macro in a CSV file. By definition the CSV format is
meant to facilitate transfer of data between different environments. It
cannot have something unique to XL in it.

What you should do is add a subroutine that first opens a particular file,
probably by asking the user for what file (see the GetOpenFilename method).
Now, the existing macro should become another so that "operates" on any
specified file, probably passed to it as an argument.

The net result is that you can open any workbook (csv or otherwise) and then
whatever you want to this file.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Greetings!

I have a recorded macro for a chart of data in an excel file.
Now the question is - how does one generate a CSV file with
that macro embedded to generate this chart dynamically.

The CSV file will be generated by a user with a series of
data (columns/rows). The macro is consistent in that it
will generate a chart based upon the SAME column/rows.
The difference is that the values will be in flux.

Generating the CSV file with the data isn't the problem.
How do you then embed the macro code to generate the chart
(for each file being created).

Regards,

Fred


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
Macro to Prompt for File -- Neophite Needs HELP kilo1990 Excel Discussion (Misc queries) 13 December 17th 05 10:34 PM
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
Opening a file in a macro (network) David P. Excel Discussion (Misc queries) 3 June 8th 05 12:35 AM
Macro to save a file as ynissel Excel Discussion (Misc queries) 4 May 26th 05 02:48 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 10:36 PM.

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

About Us

"It's about Microsoft Excel"