ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro from General to This Workbook (https://www.excelbanter.com/excel-programming/301944-macro-general-workbook.html)

mowen[_4_]

macro from General to This Workbook
 
Can someone help me to get this code such that this macro only i
available to only one workbook- (This Workbook)

Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long

I think I have to change public to something else, but how or...!?

Run

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

macro from General to This Workbook
 
Those are only API declarations. What are you trying to do?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"mowen " wrote in message
...
Can someone help me to get this code such that this macro only is
available to only one workbook- (This Workbook)

Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long

I think I have to change public to something else, but how or...!?

Rune


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

macro from General to This Workbook
 
Private Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long

Private Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long


--
Regards,
Tom Ogilvy

"mowen " wrote in message
...
Can someone help me to get this code such that this macro only is
available to only one workbook- (This Workbook)

Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long

I think I have to change public to something else, but how or...!?

Rune


---
Message posted from http://www.ExcelForum.com/




mowen[_5_]

macro from General to This Workbook
 
This is the whole code, I want to save D:\Documents an
Settings\Rune\My Documents\My Webs\myweb\public_html\Resultatliste.htm
as a web document every 5 minutes. I have to made a macro that is onl
for the spesific workbook. (Macro in This Workbook)


Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long

Public TimerID As Long
Public TimerSeconds As Single

Sub StartTimer()
TimerSeconds = 60 ' how often to "pop" the timer.
TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressO
TimerProc)
End Sub

Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"D:\Documents and Settings\Rune\My Documents\M
Webs\myweb\public_html\Resultatliste.htm" _
, FileFormat:=xlHtml, ReadOnlyRecommended:=False
CreateBackup:=False
'
' The procedure is called by Windows. Put your
' timer-related code here.
'
End Sub

best regards
Run

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 04:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com