Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default save worksheets within workbook


What I am trying to do is run a macro that will take a dat file, then d
the MOD and save into excel. Then take another dat file do the same MO
and save it in another worksheet within the same workbook file. So
guess my gold is to try to save many worksheets within one workbook.
Thanks for your help.
====

Set MonarchObj = CreateObject("Monarch32")

With MonarchObj

openfile = .SetReportFile("D:\Cash and Ad
Report\cash0902.dat", False)
If openfile = True Then
openmod = .SetModelFile("D:\Cash and Ad
Report\Cash_Adj_Rpt.mod")
If openmod = True Then
.CurrentFilter = "Cash01"
.ExportTable ("D:\Cash and Ad
Report\Cash_Adj_Rpt_09.xls")
Workbooks.Open Filename:="D:\Cash and Ad
Report\Cash_Adj_Rpt_09.xls"
Sheets(1).Copy Befo=Workbooks("Book1").Sheets(1)
End If
End If

openfile = .SetReportFile("D:\Cash and Ad
Report\cash0903.dat", False)
If openfile = True Then
openmod = .SetModelFile("D:\Cash and Ad
Report\Cash_Adj_Rpt.mod")
If openmod = True Then
.CurrentFilter = "Cash02"
.ExportTable ("D:\Cash and Ad
Report\Cash_Adj_Rpt_09.xls")
Workbooks.Open Filename:="D:\Cash and Ad
Report\Cash_Adj_Rpt_09.xls"
Sheets(1).Copy Befo=Workbooks("Book1").Sheets(1)
End If
End If

.CloseAllDocuments
.Exit

End With
Application.Quit

End Su

--
bawaho
-----------------------------------------------------------------------
bawahoo's Profile: http://www.excelforum.com/member.php...fo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=27168

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
Shared workbook - to save or not to save bluebird Excel Discussion (Misc queries) 1 November 14th 06 06:17 PM
I have a workbook of 12 worksheets. I want to only save one. how? misnobird Excel Discussion (Misc queries) 2 August 18th 06 11:16 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
save button in excel to save one of the worksheets with a cell value as its name Colin[_9_] Excel Programming 2 September 21st 04 11:28 PM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 08:13 AM.

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"