jjoy123123
Programmer
I'm opening an excel spreadsheet from my VB code, and to avoid the user being prompted to save changes, I am trying to save the spreadsheet in the code. Here's what I've got (xlsGraph is defined as a new Excel.application):
xlsGraph.Workbooks.Open ("C:\Jennifer\Work\Habach\Code\graph_a1cbyVisit.xls"
xlsGraph.Worksheets(1).Range("a1" = "25"
xlsGraph.Calculate
xlsGraph.SaveWorkspace
xlsGraph.Visible = True
xlsGraph.WindowState = xlMaximized
However, I get the following message when it gets to xlsGraph.SaveWorkspace: "A file named RESUME.XLB already exists in this location, do you want to replace it?" The weird thing is that RESUME.XLB isn't even in the same location as the spreadhseet - RESUME.XLB is only found in C:\Jennifer). If I click on OK to replace, it seems to work fine, but I'm trying to remove any user prompts.
Any ideas on how to fix this? Even if I don't do it this way, if you have any suggestions for removing any prompts to the user, that will work as well. Thanks!
xlsGraph.Workbooks.Open ("C:\Jennifer\Work\Habach\Code\graph_a1cbyVisit.xls"
xlsGraph.Worksheets(1).Range("a1" = "25"
xlsGraph.Calculate
xlsGraph.SaveWorkspace
xlsGraph.Visible = True
xlsGraph.WindowState = xlMaximized
However, I get the following message when it gets to xlsGraph.SaveWorkspace: "A file named RESUME.XLB already exists in this location, do you want to replace it?" The weird thing is that RESUME.XLB isn't even in the same location as the spreadhseet - RESUME.XLB is only found in C:\Jennifer). If I click on OK to replace, it seems to work fine, but I'm trying to remove any user prompts.
Any ideas on how to fix this? Even if I don't do it this way, if you have any suggestions for removing any prompts to the user, that will work as well. Thanks!