ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving Excel Workbook in VB6 (https://www.excelbanter.com/excel-programming/317363-saving-excel-workbook-vb6.html)

PM

Saving Excel Workbook in VB6
 
Hi!

My Workbook is referenced in my VB program as MyWB. I save it with

MyWB.SaveAs FileName:NewName

Now I want to work with NewName. The following does not work :

Set MyWB = Excel.ActiveWorkbook (for some reason ActiveWorkbook is
empty...)

Anyone know how to reference the new Workbook ?

Pat



Dmoney

Saving Excel Workbook in VB6
 
This should work for u.

ActiveWorkbook.Activate
MyWB = ActiveWorkbook.Name


-----Original Message-----
Hi!

My Workbook is referenced in my VB program as MyWB. I

save it with

MyWB.SaveAs FileName:NewName

Now I want to work with NewName. The following does not

work :

Set MyWB = Excel.ActiveWorkbook (for some reason

ActiveWorkbook is
empty...)

Anyone know how to reference the new Workbook ?

Pat


.



All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com