Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am opening an Excel file via VB. The file has vba code/macros,
which get fired off on Workbook Open. If there is an error while opening the document, I have code that kills the particular Process ID for the respective Excel file. I actually use the FindWindow API function to determine the window handle, in turn killing the corresponding id. My issue is that occassionally a 1 gets appened to the file name (e.g., Bad1.xls) and I have no clue why. Is this because a copy is created in memory somewhere? As you can see, I need the exact window name to get the corresponding processid. Since I don't understand why the 1 gets appended, I can't always assume that it will append a 1. Private Sub Command1_Click() Dim oXLS As New Excel.Application Dim oWK As New Excel.Workbook oXLS.Visible = True Set oWK = Workbooks.Open("C:\Temp\Bad.xls") Set oXLS = Nothing Set oWK = Nothing End Sub This behavior actually occurs when I do XWrk.PrintOut ActivePrinter:="Acrobat Distiller" too. Is there anyway to avoid this? Why is this happening? TIA Note: I posted this in VB group and am posting it here also |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Strange Problem in EXCEL | Excel Worksheet Functions | |||
Strange Excel problem | Setting up and Configuration of Excel | |||
Strange Excel Problem | Setting up and Configuration of Excel | |||
Strange Excel problem | Setting up and Configuration of Excel | |||
Strange Excel problem when opening an Excelbook | Excel Discussion (Misc queries) |