LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Calling a different worksheet???

Hi

I've pulled together some code that will save my spreadsheet into htm
format, and update a =now() field. In addition to that code I have some timer
codes which fire off the =now update, and the htm save.

My problem is, if I am working on another spreadsheet, it places the update
into what I'm working on - rather than the "right" file. I've tried telling
it to go to a named workbook & spreadsheet, but the problem is that the code
flicks to that file, and takes me away from the one I was working on. Very
frustrating.

The update to the now field is meant to happen every 5 minutes.

Is there a way to modify the update code so that I can work uninhibited on
other workbooks?

Cheers, Ty


Sub Every5()

Application.OnTime Now + TimeValue("00:05:00"), "SaveMe"

End Sub


Sub SaveMe()

Call UpdateMe

Dim fRange As Range
Sheets("sheet1").Activate
Application.ScreenUpdating = False
Set fRange = Range(Range("a1"), _
Range("a1").End(xlDown).End(xlToRight))
Workbooks.Open Filename:="d:\data\sc\statuses.xls"
Windows("support centre.xls").Activate
fRange.Copy
Windows("statuses.xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="d:\data\sc\statuses.htm",
FileFormat:=xlHtml, _
CreateBackup:=False
ActiveWorkbook.Close savechanges:=False

End Sub


Sub UpdateMe()

'The purpose of this code is to update the date and time
'in an appropriate format.

'This updates G24
Application.Goto reference:="R24C7"
ActiveCell.FormulaR1C1 = "=now()"
Selection.NumberFormat = "dd mmmm yyyy, h:mm AM/PM"

'Go to description box
Application.Goto reference:="R5C3"

End Sub

 
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
CALLING MACROS FROM A NEW WORKSHEET NSNR Excel Discussion (Misc queries) 4 February 1st 08 07:10 AM
calling macros from worksheet to another NSNR Excel Discussion (Misc queries) 3 October 27th 07 01:49 PM
calling up information from a different worksheet. Jay Adams Excel Worksheet Functions 0 October 8th 06 09:33 AM
Calling workbook and worksheet Anders Excel Programming 1 December 4th 05 04:42 PM
Calling a macro in another worksheet Tolga[_2_] Excel Programming 2 August 5th 04 07:03 PM


All times are GMT +1. The time now is 04:36 PM.

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"