A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

embedding a macro when generating a CSV file



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2006, 11:07 PM posted to microsoft.public.excel.charting
external usenet poster
 
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  
Old February 16th, 2006, 01:16 AM posted to microsoft.public.excel.charting
external usenet poster
 
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date range on reports Mark_Milly Setting Up & Running Reports 10 January 19th, 2006 04:49 PM
.jpg .gif .bmp file associations gone, upgrade from Office XP to 2 fbartrom Setup, Installing & Configuration 13 February 25th, 2005 02:33 PM
macro to save rtf file as txt reballdad General Discussion 1 December 20th, 2004 11:17 PM
You do not have exclusive access... ERROR Robin General Discussion 1 July 6th, 2004 01:18 AM
Productkey problem when installing office 2003 on network Stefan Schreurs Setup, Installing & Configuration 1 June 1st, 2004 11:16 PM


All times are GMT +1. The time now is 12:01 AM.


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