PC Review


Reply
Thread Tools Rate Thread

Daily Report Template

 
 
SC in Texas
Guest
Posts: n/a
 
      21st Dec 2009
I have some daily reports templates set up to open and save with a date
related name in a preset folder.
I have them working so that if the file already exists with the date in name
it will add (x). Example C:\MyReports\DailyReport 12-25-09(1).xls for the
second time template is used.
I would like to use a msgbox to give the user a choice of reopening the
first copy rather than making a second.
I have it set up to work except my statements for opening the first file
does not open it.

sample of my code:
If Ans = vbYes Then
Me.Close SaveChanges:=False
Dim wb1 As Workbook
wb1 = Workbooks.Open(myPath & myFile & myExt)
wb1.Activate
wb1.visble = True
Can anyone tell me what I am doing wrong here.
Thanks
SC

--
SC from Lubbock, Texas
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      21st Dec 2009
You are using the Me key word which in this case probably refers to the
active workbook. If you close the workbook running the code, the rest of
the code will not execute, or it might just give you an error message. Try
opening the other workbook first and then close the workbook running the
code. Better yet, if you do not really want to close the workbook running
the code, then use the actual workbook name or an object variable for it.


"SC in Texas" <(E-Mail Removed)> wrote in message
news:88096368-8322-4B8A-9C45-(E-Mail Removed)...
>I have some daily reports templates set up to open and save with a date
> related name in a preset folder.
> I have them working so that if the file already exists with the date in
> name
> it will add (x). Example C:\MyReports\DailyReport 12-25-09(1).xls for the
> second time template is used.
> I would like to use a msgbox to give the user a choice of reopening the
> first copy rather than making a second.
> I have it set up to work except my statements for opening the first file
> does not open it.
>
> sample of my code:
> If Ans = vbYes Then
> Me.Close SaveChanges:=False
> Dim wb1 As Workbook
> wb1 = Workbooks.Open(myPath & myFile & myExt)
> wb1.Activate
> wb1.visble = True
> Can anyone tell me what I am doing wrong here.
> Thanks
> SC
>
> --
> SC from Lubbock, Texas



 
Reply With Quote
 
SC in Texas
Guest
Posts: n/a
 
      22nd Dec 2009
Thanks "JLGWhiz" I finally realized that I need to change the order of the
commands while driving home yesterday. Should caught that sooner, I guess I
was hung up on needing to close the new report and open the previous made
report and was trying to do it in that order. I already fixed the problem
this morning.
SC
--
SC from Lubbock, Texas


"JLGWhiz" wrote:

> You are using the Me key word which in this case probably refers to the
> active workbook. If you close the workbook running the code, the rest of
> the code will not execute, or it might just give you an error message. Try
> opening the other workbook first and then close the workbook running the
> code. Better yet, if you do not really want to close the workbook running
> the code, then use the actual workbook name or an object variable for it.
>
>
> "SC in Texas" <(E-Mail Removed)> wrote in message
> news:88096368-8322-4B8A-9C45-(E-Mail Removed)...
> >I have some daily reports templates set up to open and save with a date
> > related name in a preset folder.
> > I have them working so that if the file already exists with the date in
> > name
> > it will add (x). Example C:\MyReports\DailyReport 12-25-09(1).xls for the
> > second time template is used.
> > I would like to use a msgbox to give the user a choice of reopening the
> > first copy rather than making a second.
> > I have it set up to work except my statements for opening the first file
> > does not open it.
> >
> > sample of my code:
> > If Ans = vbYes Then
> > Me.Close SaveChanges:=False
> > Dim wb1 As Workbook
> > wb1 = Workbooks.Open(myPath & myFile & myExt)
> > wb1.Activate
> > wb1.visble = True
> > Can anyone tell me what I am doing wrong here.
> > Thanks
> > SC
> >
> > --
> > SC from Lubbock, Texas

>
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I find a Outside Sales Daily Call Report Template? Paul Microsoft Excel Misc 1 20th Apr 2010 04:03 PM
I need a daily cash flow template PamB Microsoft Excel Misc 0 17th Sep 2009 11:48 PM
Daily Planner Template =?Utf-8?B?YmVnZQ==?= Microsoft Word Document Management 0 5th Apr 2007 06:22 AM
How do I set up template for a daily report in word? =?Utf-8?B?Sm9obg==?= Microsoft Access Forms 0 28th Mar 2006 03:51 PM
Bringing in daily totals from one report to another report =?Utf-8?B?c3RpbGxjcmF6ZWU=?= Microsoft Access Forms 0 27th Sep 2005 11:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:34 PM.