Sub DetectPossibleErrors()
'Read the following lines, try to understand, integrate it and run it
'Author: Andreas Weiss,  [EMAIL PROTECTED] , [EMAIL PROTECTED]
 
Dim strMyWorksheetWithVBA       As String
Dim strMyWorksheetWithData      As String
Dim strPathFile                 As String
 
'The following two lines shows two possible errors
'1. Don't change your windows settings
'Are you using the explorer view which shows the filename with extension or not?
'2. What is with the path to these files?
 
'Please replace the values of these two strings with
' your file1.XLS and workbook1.xls
 
strMyWorksheetWithVBA = "C:\temp\sheet_vba.xls"
strMyWorksheetWithData = "C:\temp\sheet_data.xls"
 

strPathFile = Dir(strMyWorksheetWithVBA)
MsgBox "Where is my worksheet with VBA: " & strPathFile
MsgBox "Compare your PathFile-entry: " & strMyWorksheetWithVBA & " with that what VBA founds: " & strPathFile
 
strPathFile = Dir(strMyWorksheetWithData)
MsgBox "Where is my worksheet with DATA: " & strPathFile
MsgBox "Compare your PathFile-entry: " & strMyWorksheetWithData & " with that what VBA founds: " & strPathFile
 
End Sub
-----Ursprüngliche Nachricht-----
Von: hafedh ghodhbani [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 21. September 2001 22:57
An: 'Foxboro DCS Mail List'
Betreff: Excel macros

team,
Is someone familar with Excel(5) macros? here is my problem.
I use some Excel macros to print automatically production reports on a pc. The printing macros are launched (activated) by a small package named Scheduler in the defined times.
suddenly, the package could not launch the macros, displaying a warning: invalid file specified
I spent lot of time without fixing this problem.
have so experienced this! please advive
 
How do you print automatically your reports
Could you send macros example?
below is an example of a macro included in workbook1.xls
 
Sub Auto_Open()
  
    Windows("file1.XLS").Activate
    ActiveWindow.WindowState = xlNormal
    Sheets("sheet1").Select
    Range("A70:P143").Select
    Application.ActivePrinter = "..........."
    Selection.PrintOut Copies:=1
   
    Windows("workbook1.xls").Close
End Sub
 
 
 
Regards
Hafedh ghodhbani
control and instr engineer
british gas international
hannibal gas plant Tunisia
ph 00 216 4 259 250
fx  00 216 4 259 449
 

Reply via email to