Re: 2 Excel questions using automation from VFP9SP2

2018-09-07 Thread mbsoftwaresolutions

On 2018-09-05 17:45, Richard Kaye wrote:
1 - set the saved property to .t. before you get rid of the Excel 
object.


m.loExcel.ActiveWorkbook.Saved=.t.



That worked greatThanks, Richard!

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/49907ffc7c6dde4d7f1aaa844fefd...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-07 Thread Ted Roche
Try again...

Oh, yeah, date math was my thing. From

https://support.office.com/en-us/article/NETWORKDAYS-function-48E717BF-A7A3-495F-969E-5005E3EB18E7

Is the spec. For VFP, we'll use an array of holidays range than Excel
ranges...

BONUS: Validated against http://www.workingdays.us/

* Test Work days
* duplicate Excel function NETWORKDAYS
* NETWORKDAYS(start_date, end_date, [holidays])
* The NETWORKDAYS function syntax has the following arguments:
* Start_dateRequired. A date that represents the start date.
* End_dateRequired. A date that represents the end date.
* HolidaysOptional. An optional range of one or more dates to
* exclude from the working calendar, such as state and federal holidays
* and floating holidays. The list can be either a range of cells that
* contains the dates or an array constant of the serial numbers that
represent the dates.

* DO TEST  && to test, uncomment this line

FUNCTION NetWorkDays(start_date as Date, end_date as Date, Holidays as
array)

counter = 0
FOR count = 1 TO ALEN(Holidays)
  holiday = Holidays[count]
  IF(BETWEEN(holiday, start_date, end_date) and IsWorkDay(holiday))
counter = counter -1
  ENDIF
NEXT

DO WHILE start_date <=end_date
  IF IsWorkDay(start_date)
counter = counter +1
  ENDIF
  start_date=start_date +1
ENDDO

RETURN counter

FUNCTION IsWorkDay(thedate as Date)
* ASSuMEs FDOW is 1, for VFP 6-7-8 compat. Add ,1 3rd parameter for VFP9,
assumes US-based Sat/Sun weekends,
RETURN BETWEEN(DOW(thedate),2,6)

PROCEDURE test
DIMENSION  Holidays[10]
Holidays[1] = {^2018-01-01}
Holidays[2] = {^2018-01-15}
Holidays[3] = {^2018-02-19}
Holidays[4] = {^2018-05-28}
Holidays[5] = {^2018-07-04}
Holidays[6] = {^2018-09-03}
Holidays[7] = {^2018-10-08}
Holidays[8] = {^2018-11-12}
Holidays[9] = {^2018-11-22}
Holidays[10] = {^2018-12-25}

ACTIVATE SCREEN
CLEAR
? "July: " + TRANSFORM(NetWorkDays({^2018-07-01}, {^2018-7-31}, @Holidays))
? "1st half: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-7-31},
@Holidays))
? "Full Year: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-12-31},
@Holidays))

ENDPROC

On Fri, Sep 7, 2018 at 11:33 AM Ted Roche  wrote:

> On Wed, Sep 5, 2018 at 5:45 PM Richard Kaye  wrote:
>
>> 1 - set the saved property to .t. before you get rid of the Excel object.
>>
>> m.loExcel.ActiveWorkbook.Saved=.t.
>>
>> 2 - I bet Ted wants a crack at that one. 
>>
>> --
>>
>> rk
>>
>
> Oh, yeah, date math was my thing. From
>
>
> https://support.office.com/en-us/article/NETWORKDAYS-function-48E717BF-A7A3-495F-969E-5005E3EB18E7
>
> Is the spec. For VFP, we'll use an array of holidays range than Excel
> ranges...
>
> BONUS: Validated against http://www.workingdays.us/
>
> * Test Work days
> * duplicate Excel function NETWORKDAYS
> * NETWORKDAYS(start_date, end_date, [holidays])
> * The NETWORKDAYS function syntax has the following arguments:
> * Start_dateRequired. A date that represents the start date.
> * End_dateRequired. A date that represents the end date.
> * HolidaysOptional. An optional range of one or more dates to
> * exclude from the working calendar, such as state and federal holidays
> * and floating holidays. The list can be either a range of cells that
> * contains the dates or an array constant of the serial numbers that
> represent the dates.
>
> * DO TEST  && to test, uncomment this line
>
> FUNCTION NetWorkDays(start_date as Date, end_date as Date, Holidays as
> array)
>
> counter = 0
> FOR count = 1 TO ALEN(Holidays)
>   holiday = Holidays[count]
>   IF(BETWEEN(holiday, start_date, end_date) and IsWorkDay(holiday))
> counter = counter -1
>   ENDIF
> NEXT
>
> DO WHILE start_date <=end_date
>   IF IsWorkDay(start_date)
> counter = counter +1
>   ENDIF
>   start_date=start_date +1
> ENDDO
>
> RETURN counter
>
> FUNCTION IsWorkDay(thedate as Date)
> * ASSuMEs FDOW is 1, for VFP 6-7-8 compat. Add ,1 3rd parameter for VFP9,
> assumes US-based Sat/Sun weekends,
> RETURN BETWEEN(DOW(thedate),2,6)
>
> PROCEDURE test
> DIMENSION  Holidays[10]
> Holidays[1] = {^2018-01-01}
> Holidays[2] = {^2018-01-15}
> Holidays[3] = {^2018-02-19}
> Holidays[4] = {^2018-05-28}
> Holidays[5] = {^2018-07-04}
> Holidays[6] = {^2018-09-03}
> Holidays[7] = {^2018-10-08}
> Holidays[8] = {^2018-11-12}
> Holidays[9] = {^2018-11-22}
> Holidays[10] = {^2018-12-25}
>
> ACTIVATE SCREEN
> CLEAR
> ? "July: " + TRANSFORM(NetWorkDays({^2018-07-01}, {^2018-7-31}, @Holidays))
> ? "1st half: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-7-31},
> @Holidays))
> ? "Full Year: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-12-31},
> @Holidays))
>
> ENDPROC
>
>

-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: 

Re: 2 Excel questions using automation from VFP9SP2

2018-09-07 Thread Ted Roche
On Wed, Sep 5, 2018 at 5:45 PM Richard Kaye  wrote:

> 1 - set the saved property to .t. before you get rid of the Excel object.
>
> m.loExcel.ActiveWorkbook.Saved=.t.
>
> 2 - I bet Ted wants a crack at that one. 
>
> --
>
> rk
>

Oh, yeah, date math was my thing. From

https://support.office.com/en-us/article/NETWORKDAYS-function-48E717BF-A7A3-495F-969E-5005E3EB18E7

Is the spec. For VFP, we'll use an array of holidays range than Excel
ranges...

BONUS: Validated against http://www.workingdays.us/

* Test Work days
* duplicate Excel function NETWORKDAYS
* NETWORKDAYS(start_date, end_date, [holidays])
* The NETWORKDAYS function syntax has the following arguments:
* Start_dateRequired. A date that represents the start date.
* End_dateRequired. A date that represents the end date.
* HolidaysOptional. An optional range of one or more dates to
* exclude from the working calendar, such as state and federal holidays
* and floating holidays. The list can be either a range of cells that
* contains the dates or an array constant of the serial numbers that
represent the dates.

* DO TEST  && to test, uncomment this line

FUNCTION NetWorkDays(start_date as Date, end_date as Date, Holidays as
array)

counter = 0
FOR count = 1 TO ALEN(Holidays)
  holiday = Holidays[count]
  IF(BETWEEN(holiday, start_date, end_date) and IsWorkDay(holiday))
counter = counter -1
  ENDIF
NEXT

DO WHILE start_date <=end_date
  IF IsWorkDay(start_date)
counter = counter +1
  ENDIF
  start_date=start_date +1
ENDDO

RETURN counter

FUNCTION IsWorkDay(thedate as Date)
* ASSuMEs FDOW is 1, for VFP 6-7-8 compat. Add ,1 3rd parameter for VFP9,
assumes US-based Sat/Sun weekends,
RETURN BETWEEN(DOW(thedate),2,6)

PROCEDURE test
DIMENSION  Holidays[10]
Holidays[1] = {^2018-01-01}
Holidays[2] = {^2018-01-15}
Holidays[3] = {^2018-02-19}
Holidays[4] = {^2018-05-28}
Holidays[5] = {^2018-07-04}
Holidays[6] = {^2018-09-03}
Holidays[7] = {^2018-10-08}
Holidays[8] = {^2018-11-12}
Holidays[9] = {^2018-11-22}
Holidays[10] = {^2018-12-25}

ACTIVATE SCREEN
CLEAR
? "July: " + TRANSFORM(NetWorkDays({^2018-07-01}, {^2018-7-31}, @Holidays))
? "1st half: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-7-31},
@Holidays))
? "Full Year: " + TRANSFORM(NetWorkDays({^2018-01-01}, {^2018-12-31},
@Holidays))

ENDPROC


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cacw6n4v7obf5ukvqmsdqbamu+mb2d0mjwjk188udnkvg+o3...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread mbsoftwaresolutions

On 2018-09-06 20:31, Frank Cazabon wrote:
On 06/09/2018 04:38 PM, mbsoftwaresoluti...@mbsoftwaresolutions.com 
wrote:
it's a slick formula for determining the TIME that's passed within the 
workday hours set (not just days; that'd be simple).


Are you sure about that? Everywhere I've looked it says it returns the
number of Whole workdays between two dates.



Well, ok, I see it as a fraction representing the time but yeah, it's a 
fraction of the day total using the parameters.  We use it to show total 
time spent on help desk tickets by response, SME time, and total time 
spent.


I guess it depends on your perspective.

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/ebca0ae07e74a58fd11093355c74a...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread mbsoftwaresolutions

On 2018-09-06 17:41, Stephen Russell wrote:

Do you have a table for Holidays?  We use it in our system but it also
identifies the country you are in for work.  We are USA, CA, UK for 
now.


I too tried the formula in base format in excel and it returns days 
when my

two cells were 7-30-2018 13:00:00 and 08-01-2018 23:00:00.

I didn't monkey around with cell settings to see if it changed.



It works fine in Excel; I wanted to incorporate the idea into my 
framework for when needed later on.  Just didn't want to have to fire up 
Excel just to use this function.


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/5e13bfa26dd8091526a4bffd5fbe5...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Frank Cazabon

On 06/09/2018 04:38 PM, mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
it's a slick formula for determining the TIME that's passed within the 
workday hours set (not just days; that'd be simple).


Are you sure about that? Everywhere I've looked it says it returns the 
number of Whole workdays between two dates.


Frank.

Frank Cazabon



___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/295e981f-a5ff-42d4-3383-f97d72ba1...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Frank Cazabon
This is the table I use:

USE [Calendar]
GO

/** Object:  Table [dbo].[Calendar]Script Date: 06/09/2018 06:02:16 PM 
**/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Calendar](
[dt] [date] NOT NULL,
[isWeekday] [bit] NULL,
[isHoliday] [bit] NULL,
[Y] [smallint] NULL,
[FY] [smallint] NULL,
[Q] [tinyint] NULL,
[M] [tinyint] NULL,
[D] [tinyint] NULL,
[DW] [tinyint] NULL,
[monthname] [varchar](9) NULL,
[dayname] [varchar](9) NULL,
[W] [tinyint] NULL,
[HolidayDescription] [varchar](32) NULL,
[cal_pk] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
 CONSTRAINT [PK_Calendar] PRIMARY KEY CLUSTERED 
(
[cal_pk] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

On 6 September 2018 17:41:04 GMT-04:00, Stephen Russell  
wrote:
>Do you have a table for Holidays?  We use it in our system but it also
>identifies the country you are in for work.  We are USA, CA, UK for
>now.
>
>I too tried the formula in base format in excel and it returns days
>when my
>two cells were 7-30-2018 13:00:00 and 08-01-2018 23:00:00.
>
>I didn't monkey around with cell settings to see if it changed.
>
>
>On Thu, Sep 6, 2018 at 4:00 PM Frank Cazabon 
>wrote:
>
>> Ah, didn't know that. My quick Google of it only mentioned days.
>>
>> Even if it were just days, it's definitely not that simple when you
>take
>> into consideration holidays and that some work days are Saturdays in
>some
>> places/jobs.
>>
>> I still see those complications with calculating the time.
>>
>> On 6 September 2018 16:38:11 GMT-04:00,
>> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>> >On 2018-09-05 17:54, Frank Cazabon wrote:
>> >> I use a calendar table (albeit in SQL server but that shouldn't
>> >> matter). Then it's just a matter of some simple queries.
>> >>
>> >> On 5 September 2018 16:47:27 GMT-04:00,
>> >> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>> >>> See screenshot for case matter:
>> >>> https://www.screencast.com/t/VNdRiSd1D
>> >>>
>> >>> 1) (rose highlight) I've forgotten how to get Excel to close
>without
>> >>> asking me this every time.  Currently, I'm just calling the
>.Quit()
>> >>> method of my Excel object.  I tried passing a .T. parm but that
>> >>> failed.
>> >>>
>> >>> 2) (yellow highlight) Anybody know how to get this slick
>NETWORKDAYS
>> >>> formula to work in VFP?  Would be neat to have this and I thought
>> >>> perhaps someone already built it.
>> >
>> >
>> >
>> >Frank -- it's a slick formula for determining the TIME that's passed
>> >within the workday hours set (not just days; that'd be simple).
>> >
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/dc699d68-fa9b-43b7-a513-801a37de7...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Koen Piller
For Holidays in various countries, please check the calendar class in
GitHub VFp
Koen

Op do 6 sep. 2018 om 23:41 schreef Stephen Russell :

> Do you have a table for Holidays?  We use it in our system but it also
> identifies the country you are in for work.  We are USA, CA, UK for now.
>
> I too tried the formula in base format in excel and it returns days when my
> two cells were 7-30-2018 13:00:00 and 08-01-2018 23:00:00.
>
> I didn't monkey around with cell settings to see if it changed.
>
>
> On Thu, Sep 6, 2018 at 4:00 PM Frank Cazabon 
> wrote:
>
> > Ah, didn't know that. My quick Google of it only mentioned days.
> >
> > Even if it were just days, it's definitely not that simple when you take
> > into consideration holidays and that some work days are Saturdays in some
> > places/jobs.
> >
> > I still see those complications with calculating the time.
> >
> > On 6 September 2018 16:38:11 GMT-04:00,
> > mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
> > >On 2018-09-05 17:54, Frank Cazabon wrote:
> > >> I use a calendar table (albeit in SQL server but that shouldn't
> > >> matter). Then it's just a matter of some simple queries.
> > >>
> > >> On 5 September 2018 16:47:27 GMT-04:00,
> > >> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
> > >>> See screenshot for case matter:
> > >>> https://www.screencast.com/t/VNdRiSd1D
> > >>>
> > >>> 1) (rose highlight) I've forgotten how to get Excel to close without
> > >>> asking me this every time.  Currently, I'm just calling the .Quit()
> > >>> method of my Excel object.  I tried passing a .T. parm but that
> > >>> failed.
> > >>>
> > >>> 2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
> > >>> formula to work in VFP?  Would be neat to have this and I thought
> > >>> perhaps someone already built it.
> > >
> > >
> > >
> > >Frank -- it's a slick formula for determining the TIME that's passed
> > >within the workday hours set (not just days; that'd be simple).
> > >
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cacuu1svxlmjffdcyijsftu5cvm6e9evqvgf7noci8gne4oy...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Frank Cazabon
No, the calendar table has a column to specify if a date is a holiday.

On 6 September 2018 17:41:04 GMT-04:00, Stephen Russell  
wrote:
>Do you have a table for Holidays?  We use it in our system but it also
>identifies the country you are in for work.  We are USA, CA, UK for
>now.
>
>I too tried the formula in base format in excel and it returns days
>when my
>two cells were 7-30-2018 13:00:00 and 08-01-2018 23:00:00.
>
>I didn't monkey around with cell settings to see if it changed.
>
>
>On Thu, Sep 6, 2018 at 4:00 PM Frank Cazabon 
>wrote:
>
>> Ah, didn't know that. My quick Google of it only mentioned days.
>>
>> Even if it were just days, it's definitely not that simple when you
>take
>> into consideration holidays and that some work days are Saturdays in
>some
>> places/jobs.
>>
>> I still see those complications with calculating the time.
>>
>> On 6 September 2018 16:38:11 GMT-04:00,
>> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>> >On 2018-09-05 17:54, Frank Cazabon wrote:
>> >> I use a calendar table (albeit in SQL server but that shouldn't
>> >> matter). Then it's just a matter of some simple queries.
>> >>
>> >> On 5 September 2018 16:47:27 GMT-04:00,
>> >> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>> >>> See screenshot for case matter:
>> >>> https://www.screencast.com/t/VNdRiSd1D
>> >>>
>> >>> 1) (rose highlight) I've forgotten how to get Excel to close
>without
>> >>> asking me this every time.  Currently, I'm just calling the
>.Quit()
>> >>> method of my Excel object.  I tried passing a .T. parm but that
>> >>> failed.
>> >>>
>> >>> 2) (yellow highlight) Anybody know how to get this slick
>NETWORKDAYS
>> >>> formula to work in VFP?  Would be neat to have this and I thought
>> >>> perhaps someone already built it.
>> >
>> >
>> >
>> >Frank -- it's a slick formula for determining the TIME that's passed
>> >within the workday hours set (not just days; that'd be simple).
>> >
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/26b0d1b9-734a-4c4d-ad0c-b3d6b3603...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Stephen Russell
Do you have a table for Holidays?  We use it in our system but it also
identifies the country you are in for work.  We are USA, CA, UK for now.

I too tried the formula in base format in excel and it returns days when my
two cells were 7-30-2018 13:00:00 and 08-01-2018 23:00:00.

I didn't monkey around with cell settings to see if it changed.


On Thu, Sep 6, 2018 at 4:00 PM Frank Cazabon 
wrote:

> Ah, didn't know that. My quick Google of it only mentioned days.
>
> Even if it were just days, it's definitely not that simple when you take
> into consideration holidays and that some work days are Saturdays in some
> places/jobs.
>
> I still see those complications with calculating the time.
>
> On 6 September 2018 16:38:11 GMT-04:00,
> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
> >On 2018-09-05 17:54, Frank Cazabon wrote:
> >> I use a calendar table (albeit in SQL server but that shouldn't
> >> matter). Then it's just a matter of some simple queries.
> >>
> >> On 5 September 2018 16:47:27 GMT-04:00,
> >> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
> >>> See screenshot for case matter:
> >>> https://www.screencast.com/t/VNdRiSd1D
> >>>
> >>> 1) (rose highlight) I've forgotten how to get Excel to close without
> >>> asking me this every time.  Currently, I'm just calling the .Quit()
> >>> method of my Excel object.  I tried passing a .T. parm but that
> >>> failed.
> >>>
> >>> 2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
> >>> formula to work in VFP?  Would be neat to have this and I thought
> >>> perhaps someone already built it.
> >
> >
> >
> >Frank -- it's a slick formula for determining the TIME that's passed
> >within the workday hours set (not just days; that'd be simple).
> >
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmykor-u5rvxbspo2+v8yqcqqcysjbqgxf6eok+jzbm5...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread Frank Cazabon
Ah, didn't know that. My quick Google of it only mentioned days.

Even if it were just days, it's definitely not that simple when you take into 
consideration holidays and that some work days are Saturdays in some 
places/jobs.

I still see those complications with calculating the time.

On 6 September 2018 16:38:11 GMT-04:00, 
mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>On 2018-09-05 17:54, Frank Cazabon wrote:
>> I use a calendar table (albeit in SQL server but that shouldn't
>> matter). Then it's just a matter of some simple queries.
>> 
>> On 5 September 2018 16:47:27 GMT-04:00,
>> mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>>> See screenshot for case matter:  
>>> https://www.screencast.com/t/VNdRiSd1D
>>> 
>>> 1) (rose highlight) I've forgotten how to get Excel to close without
>>> asking me this every time.  Currently, I'm just calling the .Quit()
>>> method of my Excel object.  I tried passing a .T. parm but that 
>>> failed.
>>> 
>>> 2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
>>> formula to work in VFP?  Would be neat to have this and I thought
>>> perhaps someone already built it.
>
>
>
>Frank -- it's a slick formula for determining the TIME that's passed 
>within the workday hours set (not just days; that'd be simple).
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/4fde88f6-66cf-4bec-a532-1126abda5...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread mbsoftwaresolutions
No no...despite the name, it's not a count of days; it's a count of the 
TIME (hours/minutes) within the workday parameters set.


Counting days would be easy.


On 2018-09-05 18:22, Stephen Russell wrote:

Idea on network days
for loop between the days
insert to a cursor if the DOW if not a weekend.
count rows of cursor.

Holidays you are on your own :)

On Wed, Sep 5, 2018 at 4:35 PM 


wrote:

See screenshot for case matter:  
https://www.screencast.com/t/VNdRiSd1D


1) (rose highlight) I've forgotten how to get Excel to close without
asking me this every time.  Currently, I'm just calling the .Quit()
method of my Excel object.  I tried passing a .T. parm but that 
failed.


2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
formula to work in VFP?  Would be neat to have this and I thought
perhaps someone already built it.

tia,
--Mike



[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/0b9e276fe817c836bfed24930f7d1...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-06 Thread mbsoftwaresolutions

On 2018-09-05 17:54, Frank Cazabon wrote:

I use a calendar table (albeit in SQL server but that shouldn't
matter). Then it's just a matter of some simple queries.

On 5 September 2018 16:47:27 GMT-04:00,
mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
See screenshot for case matter:  
https://www.screencast.com/t/VNdRiSd1D


1) (rose highlight) I've forgotten how to get Excel to close without
asking me this every time.  Currently, I'm just calling the .Quit()
method of my Excel object.  I tried passing a .T. parm but that 
failed.


2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
formula to work in VFP?  Would be neat to have this and I thought
perhaps someone already built it.




Frank -- it's a slick formula for determining the TIME that's passed 
within the workday hours set (not just days; that'd be simple).


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/d491dd76de64ba00d6b734f70dd7f...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-05 Thread Fernando D. Bozzo
Hi:

About (1), y thinq you could use the same value that makes Word quit
without saving, which is *Quit(0)* (can't find any doc about Quit)

Another option is closing de document without saving using *Close(0)*
method then quitting.
https://docs.microsoft.com/en-gb/visualstudio/vsto/how-to-programmatically-close-documents?view=vs-2017

Hope it helps.

Fernando D. Bozzo



2018-09-05 22:47 GMT+02:00 :

> See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D
>
> 1) (rose highlight) I've forgotten how to get Excel to close without
> asking me this every time.  Currently, I'm just calling the .Quit() method
> of my Excel object.  I tried passing a .T. parm but that failed.
>
> 2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
> formula to work in VFP?  Would be neat to have this and I thought perhaps
> someone already built it.
>
> tia,
> --Mike
>
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cagq_jumopzvcsbs_j09kc2aqpu5tarxanhicjng5ge7mpza...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-05 Thread Stephen Russell
Idea on network days
for loop between the days
insert to a cursor if the DOW if not a weekend.
count rows of cursor.

Holidays you are on your own :)

On Wed, Sep 5, 2018 at 4:35 PM 
wrote:

> See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D
>
> 1) (rose highlight) I've forgotten how to get Excel to close without
> asking me this every time.  Currently, I'm just calling the .Quit()
> method of my Excel object.  I tried passing a .T. parm but that failed.
>
> 2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS
> formula to work in VFP?  Would be neat to have this and I thought
> perhaps someone already built it.
>
> tia,
> --Mike
>
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmylqucx6z3vshf2lih2_w_ctiuzk5nzjdpynbe4wmnu...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: 2 Excel questions using automation from VFP9SP2

2018-09-05 Thread Frank Cazabon
I use a calendar table (albeit in SQL server but that shouldn't matter). Then 
it's just a matter of some simple queries.

On 5 September 2018 16:47:27 GMT-04:00, 
mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D
>
>1) (rose highlight) I've forgotten how to get Excel to close without 
>asking me this every time.  Currently, I'm just calling the .Quit() 
>method of my Excel object.  I tried passing a .T. parm but that failed.
>
>2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS 
>formula to work in VFP?  Would be neat to have this and I thought 
>perhaps someone already built it.
>
>tia,
>--Mike
>
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cc9cb697-6602-488a-a5ec-4d7326387...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: 2 Excel questions using automation from VFP9SP2

2018-09-05 Thread Richard Kaye
1 - set the saved property to .t. before you get rid of the Excel object.

m.loExcel.ActiveWorkbook.Saved=.t.

2 - I bet Ted wants a crack at that one. 

--

rk

-Original Message-
From: ProfoxTech  On Behalf Of 
mbsoftwaresoluti...@mbsoftwaresolutions.com
Sent: Wednesday, September 5, 2018 4:47 PM
To: profoxt...@leafe.com
Subject: 2 Excel questions using automation from VFP9SP2

See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D

1) (rose highlight) I've forgotten how to get Excel to close without asking me 
this every time.  Currently, I'm just calling the .Quit() method of my Excel 
object.  I tried passing a .T. parm but that failed.

2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS formula to 
work in VFP?  Would be neat to have this and I thought perhaps someone already 
built it.

tia,
--Mike


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/c098c4933dff7f770255511062c0d...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Report [OT] Abuse: 
http://leafe.com/reportAbuse/c098c4933dff7f770255511062c0d...@mbsoftwaresolutions.com

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/bn6pr10mb1299a8b2b534dddba36588fcd2...@bn6pr10mb1299.namprd10.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Re: 2 Excel questions using automation from VFP9SP2

2018-09-05 Thread Frank Cazabon
Is it displayalerts for question 1?

On 5 September 2018 16:47:27 GMT-04:00, 
mbsoftwaresoluti...@mbsoftwaresolutions.com wrote:
>See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D
>
>1) (rose highlight) I've forgotten how to get Excel to close without 
>asking me this every time.  Currently, I'm just calling the .Quit() 
>method of my Excel object.  I tried passing a .T. parm but that failed.
>
>2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS 
>formula to work in VFP?  Would be neat to have this and I thought 
>perhaps someone already built it.
>
>tia,
>--Mike
>
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/14a6ce70-5ec2-47f4-b486-44cd859a0...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


2 Excel questions using automation from VFP9SP2

2018-09-05 Thread mbsoftwaresolutions

See screenshot for case matter:  https://www.screencast.com/t/VNdRiSd1D

1) (rose highlight) I've forgotten how to get Excel to close without 
asking me this every time.  Currently, I'm just calling the .Quit() 
method of my Excel object.  I tried passing a .T. parm but that failed.


2) (yellow highlight) Anybody know how to get this slick NETWORKDAYS 
formula to work in VFP?  Would be neat to have this and I thought 
perhaps someone already built it.


tia,
--Mike


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/c098c4933dff7f770255511062c0d...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.