Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - SaveAs hangs (2003 vs 2k ?)

I've searched this forum and a bunch of microsoft docs and have no
found a solution to my problem, so I'm wondering if anyone here know
why this is happening:

My code below executes perfectly on my PC running Excel 2003. But whe
I attempt to run it on 2 other PCs, both running Excel 2000 for wha
it's worth, the code simply hangs at the "SaveAs" ... no error o
anything...

I don't know for sure whether it is version-related (2k v. 2003)..
just throwing that out there since this DOES WORK on my 2003 machine..
in fact I am out of ideas as to why this would happen.

Anyone seen anything like this?
Am I doing something wrong?
Any clues would be greatly appreciated

Thanks!
Mike

My code:

[font=courier new]


Private Sub SaveGraph()
Dim xExcelApp As New Excel.Application
Dim xWorkbk As Excel.Workbook
Dim xTempName As String
Dim xSaveName As String
Dim xPath As String

Set xWorkbk = xExcelApp.Workbooks.Add


' ===============================
'Create Graph Here
' ===============================

xPath = "C:\temp\"
xTempName = xPath & "test_graph.xls"

ChDir xPath

xSaveName = m_objExcelApp.GetSaveAsFilename( _
InitialFileName:=xTempName, _
FileFilter:="Microsoft Excel Workboo
(*.xls), *.xls")

MsgBox "saving..."
xWorkbk.SaveAs FileName:=xSaveName ' << dies here
MsgBox "saved!"



End Sub


[/FONT

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - SaveAs hangs (2003 vs 2k ?)

Nobody? Any ideas?

Thanks again,
Mik

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default VBA - SaveAs hangs (2003 vs 2k ?)

Mike,

Just taking some guesses.

Have you tried passing the filename by position, instead of by name.
xWorkbk.SaveAs xSaveName

Do you have the application visible?
xExcelApp.Visible = True

I see you have another variable: m_objExcelApp
Where is this defined. Is it visible?

Troy


"mtrak " wrote in message
...
I've searched this forum and a bunch of microsoft docs and have not
found a solution to my problem, so I'm wondering if anyone here knows
why this is happening:

My code below executes perfectly on my PC running Excel 2003. But when
I attempt to run it on 2 other PCs, both running Excel 2000 for what
it's worth, the code simply hangs at the "SaveAs" ... no error or
anything...

I don't know for sure whether it is version-related (2k v. 2003)...
just throwing that out there since this DOES WORK on my 2003 machine...
in fact I am out of ideas as to why this would happen.

Anyone seen anything like this?
Am I doing something wrong?
Any clues would be greatly appreciated

Thanks!
Mike

My code:




Private Sub SaveGraph()
Dim xExcelApp As New Excel.Application
Dim xWorkbk As Excel.Workbook
Dim xTempName As String
Dim xSaveName As String
Dim xPath As String

Set xWorkbk = xExcelApp.Workbooks.Add


' ===============================
'Create Graph Here
' ===============================

xPath = "C:\temp\"
xTempName = xPath & "test_graph.xls"

ChDir xPath

xSaveName = m_objExcelApp.GetSaveAsFilename( _
InitialFileName:=xTempName, _
FileFilter:="Microsoft Excel Workbook
(*.xls), *.xls")

MsgBox "saving..."
xWorkbk.SaveAs FileName:=xSaveName ' << dies here
MsgBox "saved!"



End Sub





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



Reply
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
hangs when connected Gerhard Adendorff Excel Discussion (Misc queries) 0 April 13th 07 06:56 AM
Excel 2003 SP2 hangs on HTML paste AndyB Excel Discussion (Misc queries) 0 November 23rd 05 02:31 PM
Excel 2003 hangs when trying to locate a workbook to open Darren Hill via OfficeKB.com Excel Discussion (Misc queries) 1 March 24th 05 12:41 PM
Worksheet hangs Robert Excel Discussion (Misc queries) 2 March 14th 05 06:21 AM
Excel 2003 hangs with dates in user forms hlask Excel Programming 0 June 3rd 04 09:21 AM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"