Hi All,
I have a code that opens an embedded excel thru VBA, saves it on a user-specified location, closes the embedded file. Then the saved file will be opened and edited,
The problem that i'm facing is dat when i try to save the embedded sheet, excel crashes with no specified error. It simply crashes. I've no idea what to do. Please help....
My code is as shown below:
The Excel crashes at point
or
Please guide. Thanks in advance...
I have a code that opens an embedded excel thru VBA, saves it on a user-specified location, closes the embedded file. Then the saved file will be opened and edited,
The problem that i'm facing is dat when i try to save the embedded sheet, excel crashes with no specified error. It simply crashes. I've no idea what to do. Please help....
My code is as shown below:
Code:
Set XlWbk = ThisWorkbook
Set oEmbFile = XlWbk.Sheets("Release Note Template").OLEObjects("Release Note Template")
oEmbFile.Verb Verb:=xlPrimary
Set XlRN = oEmbFile.Object
re_path2:
saveaspath = Application.GetSaveAsFilename(InitialFileName:=home, Title:="Save the Release Note as...", _
FileFilter:="Excel 2007 Files (*.xlsx), *.xlsx, Excel 97-2003 Files (*.xls), *.xls")
'Application.StatusBar = "Saving the Release Note..."
a = MsgBox("Save the Release Note on path " & saveaspath & "?", vbQuestion + vbYesNo)
If a = vbNo Then GoTo re_path2
'XlRN.SaveCopyAs saveaspath
XlRN.Activate
XlRN.SaveAs filename:=saveaspath, ReadOnlyRecommended:=False, CreateBackup:=False ', FileFormat:=xlNormal
XlRN.Close
Set oEmbFile = Nothing
Set XlRN = Nothing
Set XlRN = oExcel.Workbooks.Open(saveaspath)
XlWbk.Activate
wsRNT.Activate
Code:
XlRN.SaveCopyAs saveaspath
Code:
XlRN.SaveAs filename:=saveaspath...