Creating Charts Using Data from another Workbook

  • Thread starter Ray Chang via AdminLife
  • Start date
R

Ray Chang via AdminLife

I am currently trying to write a VBA program that prompts theuser to search for a text file. The text file is then opened ina new workbook, has its data arranged into specific columns, andthen saves it as a new xls file. Then, the program is supposedto read data from several of the columns, and create a chartbased on the data.

Here is the problem. It opens the file, arranges it intocolumns, saves it as a new workbook, highlights the columns Ineed to use to make the chart, but then creates a blank chart inthe old workbook (the one with the macro in it) and then crashessaying that the data is out of range. How do I make it insteadmake a new chart in the new workbook, and use the data from thenew workbook to make it into a graph (the actual creating of agraph works seperate from the rest of the program).
 
T

Tom Ogilvy

Just modify the existing code to do what it is doing in the correct
location.

--
Regards,
Tom Ogilvy

I am currently trying to write a VBA program that prompts the user to search
for a text file. The text file is then opened in a new workbook, has its
data arranged into specific columns, and then saves it as a new xls file.
Then, the program is supposed to read data from several of the columns, and
create a chart based on the data.

Here is the problem. It opens the file, arranges it into columns, saves it
as a new workbook, highlights the columns I need to use to make the chart,
but then creates a blank chart in the old workbook (the one with the macro
in it) and then crashes saying that the data is out of range. How do I make
it instead make a new chart in the new workbook, and use the data from the
new workbook to make it into a graph (the actual creating of a graph works
seperate from the rest of the program).
 
Top