Information générale
Titre:
FoxPro and Excel-- Problem with macro
Hello guys ,
Perhaps this is not the place to put this but, see if you can help me:
I have this app that after the SQL select builds this table and then exports it to an EXCEL file, now I have this template that reads in this file and then formats it,(that's what is suppossed to do).
The problem is that when the following code runs (VB macro in the Excel template)
Workbooks.Open FileName:="C:\SMART\TEMP\TEST1.XLS"
Cells.select <-- It dies here *****
Selection.Columns.AutoFit
Range("A1").Select
Range("A2:M23").Select
Selection.Copy
ActiveWindow.WindowState = xlMinimized
ActiveWindow.WindowState = xlMaximized
Range("B12").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveWindow.ScrollColumn = 4
It gives me a 1004 runtime error, 'select method of range failed'
It ocurrs whenever you have empty info in the workbook or the object workbook does not exist.. but It does exists ..
anybody ,, help!!
Mark Oliva
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement